8000 bug #43533 [Uid] fix 4 missing bits of entropy in UUIDv4 (nicolas-gre… · symfony/symfony@95f5209 · GitHub
[go: up one dir, main page]

Skip to content

Commit 95f5209

Browse files
bug #43533 [Uid] fix 4 missing bits of entropy in UUIDv4 (nicolas-grekas)
This PR was merged into the 5.3 branch. Discussion ---------- [Uid] fix 4 missing bits of entropy in UUIDv4 | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #42787 | License | MIT | Doc PR | - Commits ------- 694b4fd [Uid] fix 4 missing bits of entropy in UUIDv4
2 parents 166ca8d + 694b4fd commit 95f5209

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Uid/UuidV4.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(string $uuid = null)
2424
{
2525
if (null === $uuid) {
2626
$uuid = random_bytes(16);
27-
$uuid[6] = $uuid[6] & "\x0F" | "\x4F";
27+
$uuid[6] = $uuid[6] & "\x0F" | "\x40";
2828
$uuid[8] = $uuid[8] & "\x3F" | "\x80";
2929
$uuid = bin2hex($uuid);
3030

0 commit comments

Comments
 (0)
0