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

Function uuid4

Lib/uuid.py:774–779  ·  view source on GitHub ↗

Generate a random UUID.

()

Source from the content-addressed store, hash-verified

772 return UUID._from_int(int_uuid_3)
773
774def uuid4():
775 """Generate a random UUID."""
776 int_uuid_4 = int.from_bytes(os.urandom(16))
777 int_uuid_4 &= _RFC_4122_CLEARFLAGS_MASK
778 int_uuid_4 |= _RFC_4122_VERSION_4_FLAGS
779 return UUID._from_int(int_uuid_4)
780
781def uuid5(namespace, name):
782 """Generate a UUID from the SHA-1 hash of a namespace UUID and a name."""

Callers

nothing calls this directly

Calls 2

_from_intMethod · 0.80
from_bytesMethod · 0.45

Tested by

no test coverage detected