MCPcopy Index your code
hub / github.com/python/cpython / uuid4

Function uuid4

Lib/uuid.py:775–780  ·  view source on GitHub ↗

Generate a random UUID.

()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

_from_intMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…