Skip to content

Commit 54eae41

Browse files
committed
Add separators
1 parent 9720788 commit 54eae41

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/FoundationEssentials/UUID.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ public struct UUID : Hashable, Equatable, CustomStringConvertible, Sendable {
9292
var secondBits = second
9393

9494
// Set the version to 4 (0100 in binary)
95-
firstBits &= 0b1111111111111111111111111111111111111111111111110000111111111111 // Clear bits 48 through 51
96-
firstBits |= 0b0000000000000000000000000000000000000000000000000100000000000000 // Set the version bits to '0100' at the correct position
95+
firstBits &= 0b11111111_11111111_11111111_11111111_11111111_11111111_00001111_11111111 // Clear bits 48 through 51
96+
firstBits |= 0b00000000_00000000_00000000_00000000_00000000_00000000_01000000_00000000 // Set the version bits to '0100' at the correct position
9797

9898
// Set the variant to '10' (RFC9562 variant)
99-
secondBits &= 0b0011111111111111111111111111111111111111111111111111111111111111 // Clear the 2 most significant bits
100-
secondBits |= 0b1000000000000000000000000000000000000000000000000000000000000000 // Set the two MSB to '10'
99+
secondBits &= 0b00111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111 // Clear the 2 most significant bits
100+
secondBits |= 0b10000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000 // Set the two MSB to '10'
101101

102102
let uuidBytes = (
103103
UInt8(truncatingIfNeeded: firstBits >> 56),

0 commit comments

Comments
 (0)