MCPcopy Index your code
hub / github.com/RustPython/RustPython / _uuid7_get_counter_and_tail

Function _uuid7_get_counter_and_tail

Lib/uuid.py:835–841  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

833_last_counter_v7 = 0 # 42-bit counter
834
835def _uuid7_get_counter_and_tail():
836 rand = int.from_bytes(os.urandom(10))
837 # 42-bit counter with MSB set to 0
838 counter = (rand >> 32) & 0x1ff_ffff_ffff
839 # 32-bit random data
840 tail = rand & 0xffff_ffff
841 return counter, tail
842
843
844def uuid7():

Callers 1

uuid7Function · 0.85

Calls 1

from_bytesMethod · 0.45

Tested by

no test coverage detected