← All changes
|
includes/sdk/google/ramsey/uuid/src/BinaryUtils.php
+15
-22
1.2.3
→
1.4.2
View file →
| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | * @copyright Copyright (c) Ben Ramsey <[email protected]> |
| 10 | 10 | * @license http://opensource.org/licenses/MIT MIT |
| 11 | 11 | */ |
| 12 | 12 | declare (strict_types=1); |
| 13 | -namespace Dudlewebs\WPMCS\Ramsey\Uuid; | |
| 13 | +namespace Dudlewebs\WPMCS\GCP\Ramsey\Uuid; | |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Provides binary math utilities |
| 17 | 17 | */ |
| @@ -17,42 +17,35 @@ | ||
| 17 | 17 | */ |
| 18 | 18 | class BinaryUtils |
| 19 | 19 | { |
| 20 | 20 | /** |
| 21 | - * Applies the RFC 4122 variant field to the 16-bit clock sequence | |
| 21 | + * Applies the variant field to the 16-bit clock sequence | |
| 22 | 22 | * |
| 23 | - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant | |
| 23 | + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field | |
| 24 | 24 | * |
| 25 | - * @param int $clockSeq The 16-bit clock sequence value before the RFC 4122 | |
| 26 | - * variant is applied | |
| 25 | + * @param int $clockSeq The 16-bit clock sequence value before the variant is applied | |
| 27 | 26 | * |
| 28 | 27 | * @return int The 16-bit clock sequence multiplexed with the UUID variant |
| 29 | 28 | * |
| 30 | - * @psalm-pure | |
| 29 | + * @pure | |
| 31 | 30 | */ |
| 32 | - public static function applyVariant(int $clockSeq): int | |
| 31 | + public static function applyVariant(int $clockSeq) : int | |
| 33 | 32 | { |
| 34 | - $clockSeq = $clockSeq & 0x3fff; | |
| 35 | - $clockSeq |= 0x8000; | |
| 36 | - return $clockSeq; | |
| 33 | + return $clockSeq & 0x3fff | 0x8000; | |
| 37 | 34 | } |
| 38 | 35 | /** |
| 39 | - * Applies the RFC 4122 version number to the 16-bit `time_hi_and_version` field | |
| 36 | + * Applies the version field to the 16-bit `time_hi_and_version` field | |
| 40 | 37 | * |
| 41 | - * @link http://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version | |
| 38 | + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field | |
| 42 | 39 | * |
| 43 | - * @param int $timeHi The value of the 16-bit `time_hi_and_version` field | |
| 44 | - * before the RFC 4122 version is applied | |
| 45 | - * @param int $version The RFC 4122 version to apply to the `time_hi` field | |
| 40 | + * @param int $timeHi The value of the 16-bit `time_hi_and_version` field before the version is applied | |
| 41 | + * @param int $version The version to apply to the `time_hi` field | |
| 46 | 42 | * |
| 47 | - * @return int The 16-bit time_hi field of the timestamp multiplexed with | |
| 48 | - * the UUID version number | |
| 43 | + * @return int The 16-bit time_hi field of the timestamp multiplexed with the UUID version number | |
| 49 | 44 | * |
| 50 | - * @psalm-pure | |
| 45 | + * @pure | |
| 51 | 46 | */ |
| 52 | - public static function applyVersion(int $timeHi, int $version): int | |
| 47 | + public static function applyVersion(int $timeHi, int $version) : int | |
| 53 | 48 | { |
| 54 | - $timeHi = $timeHi & 0xfff; | |
| 55 | - $timeHi |= $version << 12; | |
| 56 | - return $timeHi; | |
| 49 | + return $timeHi & 0xfff | $version << 12; | |
| 57 | 50 | } |
| 58 | 51 | } |