File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/Symfony/Component/Uid Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public static function generate(?\DateTimeInterface $time = null): string
60
60
61
61
if ($ time > self ::$ time || (null !== $ mtime && $ time !== self ::$ time )) {
62
62
randomize:
63
- self ::$ rand = unpack ('n * ' , isset (self ::$ seed ) ? random_bytes (10 ) : self ::$ seed = random_bytes (16 ));
63
+ self ::$ rand = unpack ('S * ' , isset (self ::$ seed ) ? random_bytes (10 ) : self ::$ seed = random_bytes (16 ));
64
64
self ::$ rand [1 ] &= 0x03FF ;
65
65
self ::$ time = $ time ;
66
66
} else {
@@ -76,7 +76,7 @@ public static function generate(?\DateTimeInterface $time = null): string
76
76
// 24-bit number in the self::$seedParts list and decrement self::$seedIndex.
77
77
78
78
if (!self ::$ seedIndex ) {
79
- $ s = unpack ('l* ' , self ::$ seed = hash ('sha512 ' , self ::$ seed , true ));
79
+ $ s = unpack (\ PHP_INT_SIZE >= 8 ? ' L* ' : 'l* ' , self ::$ seed = hash ('sha512 ' , self ::$ seed , true ));
80
80
$ s [] = ($ s [1 ] >> 8 & 0xFF0000 ) | ($ s [2 ] >> 16 & 0xFF00 ) | ($ s [3 ] >> 24 & 0xFF );
81
81
$ s [] = ($ s [4 ] >> 8 & 0xFF0000 ) | ($ s [5 ] >> 16 & 0xFF00 ) | ($ s [6 ] >> 24 & 0xFF );
82
82
$ s [] = ($ s [7 ] >> 8 & 0xFF0000 ) | ($ s [8 ] >> 16 & 0xFF00 ) | ($ s [9 ] >> 24 & 0xFF );
You can’t perform that action at this time.
0 commit comments