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

Commit

Permalink
fix variant
Browse files Browse the repository at this point in the history
  • Loading branch information
hamiltop committed May 30, 2017
1 parent 9368610 commit 7ceb974
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/uuid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ module Version
# Version number stamped into the UUID to identify it as time-based.
VERSION_CLOCK = 0x1000

##
# Variant number stamped into the UUID to identify it RFC4211.
VARIANT_CLOCK = 0x80

##
# Formats supported by the UUID generator.
#
Expand Down Expand Up @@ -320,7 +324,7 @@ def generate(format = :default)
clock & 0xFFFFFFFF,
(clock >> 32) & 0xFFFF,
((clock >> 48) & 0xFFFF | VERSION_CLOCK),
(@sequence >> 8) & 0xFF | 0x80,
(@sequence >> 8) & 0xBF | 0x80,
@sequence & 0xFF,
@mac & 0xFFFFFFFFFFFF
]
Expand Down

0 comments on commit 7ceb974

Please sign in to comment.