Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Use correct variant and version in UUID #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hamiltop
Copy link

As pointed out in #33 , the current implementation does not conform to https://www.ietf.org/rfc/rfc4122.txt with regards to version and variant.

This pull request corrects that by properly setting the variant and version.

@hamiltop
Copy link
Author

Another fork has also addressed this in a slightly different manner: L2G@17b6a9c

@@ -320,7 +324,8 @@ def generate(format = :default)
clock & 0xFFFFFFFF,
(clock >> 32) & 0xFFFF,
((clock >> 48) & 0xFFFF | VERSION_CLOCK),
@sequence & 0xFFFF,
(@sequence >> 8) & 0xBF | 0x80,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't 0x80 be VARIANT_CLOCK?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants