We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be4da65 commit 00aa497Copy full SHA for 00aa497
1 file changed
src/uuid6/__init__.py
@@ -132,7 +132,9 @@ def uuid7() -> UUID:
132
subsec_a = subsec >> 18
133
subsec_b = (subsec >> 6) & 0x0FFF
134
subsec_c = subsec & 0x3F
135
- rand = secrets.randbits(56)
+ rand = 0
136
+ while rand == 0:
137
+ rand = secrets.randbits(56)
138
uuid_int = (timestamp_s & 0x0FFFFFFFFF) << 92
139
uuid_int |= subsec_a << 80
140
uuid_int |= subsec_b << 64
0 commit comments