LLLLLLLL-MMMM-VHHH-RSSS-NNNNNNNNNNNN
Where:
L = Low Time
M = Mid Time
V = Version (1)
H = High Time
R = Variant (in range 8-b inclusive as is starts 0b10......)
S = Sequence number
N = Node
NB Each Letter is a nibble (hex digit) not a byte
With the code as it stands in the high bits of the node are set, it is or'd in with the bytes that are used for the RSSS - i.e. corrupting the sequence number or even the variant.
This is a tiny fix that ensures the 4 nibbles (two bytes) that are reserved for the sequence number+variant are not or'd with the node.
https://www.uuidtools.com/uuid-versions-explained Explains that a type 1 uuid is of the form
LLLLLLLL-MMMM-VHHH-RSSS-NNNNNNNNNNNN Where: L = Low Time M = Mid Time V = Version (1) H = High Time R = Variant (in range 8-b inclusive as is starts 0b10......) S = Sequence number N = Node
NB Each Letter is a nibble (hex digit) not a byte
With the code as it stands in the high bits of the node are set, it is or'd in with the bytes that are used for the RSSS - i.e. corrupting the sequence number or even the variant.
This is a tiny fix that ensures the 4 nibbles (two bytes) that are reserved for the sequence number+variant are not or'd with the node.