|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / dev2.destoffenstraat.com / vendor / ramsey / uuid / src / |
Filename | /home/dev2.destoffenstraat.com/vendor/ramsey/uuid/src/BinaryUtils.php |
Size | 1.1 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 17-Aug-2025 10:26 |
Last modified | 20-Jul-2018 01:38 |
Last accessed | 23-Aug-2025 03:56 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
namespace Ramsey\Uuid;
/**
* Provides binary math utilities
*/
class BinaryUtils
{
/**
* Applies the RFC 4122 variant field to the `clock_seq_hi_and_reserved` field
*
* @param $clockSeqHi
* @return int The high field of the clock sequence multiplexed with the variant
* @link http://tools.ietf.org/html/rfc4122#section-4.1.1
*/
public static function applyVariant($clockSeqHi)
{
// Set the variant to RFC 4122
$clockSeqHi = $clockSeqHi & 0x3f;
$clockSeqHi &= ~(0xc0);
$clockSeqHi |= 0x80;
return $clockSeqHi;
}
/**
* Applies the RFC 4122 version number to the `time_hi_and_version` field
*
* @param string $timeHi
* @param integer $version
* @return int The high field of the timestamp multiplexed with the version number
* @link http://tools.ietf.org/html/rfc4122#section-4.1.3
*/
public static function applyVersion($timeHi, $version)
{
$timeHi = hexdec($timeHi) & 0x0fff;
$timeHi &= ~(0xf000);
$timeHi |= $version << 12;
return $timeHi;
}
}
namespace Ramsey\Uuid;
/**
* Provides binary math utilities
*/
class BinaryUtils
{
/**
* Applies the RFC 4122 variant field to the `clock_seq_hi_and_reserved` field
*
* @param $clockSeqHi
* @return int The high field of the clock sequence multiplexed with the variant
* @link http://tools.ietf.org/html/rfc4122#section-4.1.1
*/
public static function applyVariant($clockSeqHi)
{
// Set the variant to RFC 4122
$clockSeqHi = $clockSeqHi & 0x3f;
$clockSeqHi &= ~(0xc0);
$clockSeqHi |= 0x80;
return $clockSeqHi;
}
/**
* Applies the RFC 4122 version number to the `time_hi_and_version` field
*
* @param string $timeHi
* @param integer $version
* @return int The high field of the timestamp multiplexed with the version number
* @link http://tools.ietf.org/html/rfc4122#section-4.1.3
*/
public static function applyVersion($timeHi, $version)
{
$timeHi = hexdec($timeHi) & 0x0fff;
$timeHi &= ~(0xf000);
$timeHi |= $version << 12;
return $timeHi;
}
}