Skip to content

Commit a69f69f

Browse files
Merge branch '7.2' into 7.3
* 7.2: - [Console] Table counts wrong column width when using colspan and `setColumnMaxWidth()` [Console] Table counts wrong number of padding symbols in `renderCell()` method when cell contain unicode variant selector [Cache] Fix using a `ChainAdapter` as an adapter for a pool [Serializer] Fix collect_denormalization_errors flag in defaultContext [TypeInfo] Fix handling `ConstFetchNode` [VarDumper] Avoid deprecated call in PgSqlCaster Fix command option mode (InputOption::VALUE_REQUIRED) use an EOL-agnostic approach to parse class uses [Uid] Improve entropy of the increment for UUIDv7 [HttpKernel] Fix `#[MapUploadedFile]` handling for optional file uploads
2 parents 7beeb2b + 41aced5 commit a69f69f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

UuidV7.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static function generate(?\DateTimeInterface $time = null): string
6262

6363
if ($time > self::$time || (null !== $mtime && $time !== self::$time)) {
6464
randomize:
65-
self::$rand = unpack('n*', isset(self::$seed) ? random_bytes(10) : self::$seed = random_bytes(16));
65+
self::$rand = unpack('S*', isset(self::$seed) ? random_bytes(10) : self::$seed = random_bytes(16));
6666
self::$rand[1] &= 0x03FF;
6767
self::$time = $time;
6868
} else {
@@ -78,7 +78,7 @@ public static function generate(?\DateTimeInterface $time = null): string
7878
// 24-bit number in the self::$seedParts list and decrement self::$seedIndex.
7979

8080
if (!self::$seedIndex) {
81-
$s = unpack('l*', self::$seed = hash('sha512', self::$seed, true));
81+
$s = unpack(\PHP_INT_SIZE >= 8 ? 'L*' : 'l*', self::$seed = hash('sha512', self::$seed, true));
8282
$s[] = ($s[1] >> 8 & 0xFF0000) | ($s[2] >> 16 & 0xFF00) | ($s[3] >> 24 & 0xFF);
8383
$s[] = ($s[4] >> 8 & 0xFF0000) | ($s[5] >> 16 & 0xFF00) | ($s[6] >> 24 & 0xFF);
8484
$s[] = ($s[7] >> 8 & 0xFF0000) | ($s[8] >> 16 & 0xFF00) | ($s[9] >> 24 & 0xFF);

0 commit comments

Comments
 (0)