Skip to content

Commit

Permalink
Merge pull request #158 from GrahamCampbell/analysis-GD5roO
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
GrahamCampbell authored Nov 21, 2021
2 parents 468f06c + 4fad814 commit a60bdff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Identifier/UuidV4Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public static function generate()
{
$hash = bin2hex(random_bytes(16));

$timeHi = hexdec(substr($hash, 12, 4)) & 0x0fff;
$timeHi &= ~(0xf000);
$timeHi = hexdec(substr($hash, 12, 4)) & 0x0FFF;
$timeHi &= ~(0xF000);
$timeHi |= 4 << 12;

$clockSeqHi = hexdec(substr($hash, 16, 2)) & 0x3f;
$clockSeqHi &= ~(0xc0);
$clockSeqHi = hexdec(substr($hash, 16, 2)) & 0x3F;
$clockSeqHi &= ~(0xC0);
$clockSeqHi |= 0x80;

$params = [substr($hash, 0, 8), substr($hash, 8, 4), sprintf('%04x', $timeHi), sprintf('%02x', $clockSeqHi), substr($hash, 18, 2), substr($hash, 20, 12)];
Expand Down

0 comments on commit a60bdff

Please sign in to comment.