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

Function uuid3

Lib/uuid.py:764–773  ·  view source on GitHub ↗

Generate a UUID from the MD5 hash of a namespace UUID and a name.

(namespace, name)

Source from the content-addressed store, hash-verified

762 clock_seq_hi_variant, clock_seq_low, node), version=1)
763
764def uuid3(namespace, name):
765 """Generate a UUID from the MD5 hash of a namespace UUID and a name."""
766 if isinstance(name, str):
767 name = bytes(name, "utf-8")
768 import hashlib
769 h = hashlib.md5(namespace.bytes + name, usedforsecurity=False)
770 int_uuid_3 = int.from_bytes(h.digest())
771 int_uuid_3 &= _RFC_4122_CLEARFLAGS_MASK
772 int_uuid_3 |= _RFC_4122_VERSION_3_FLAGS
773 return UUID._from_int(int_uuid_3)
774
775def uuid4():
776 """Generate a random UUID."""

Callers

nothing calls this directly

Calls 2

_from_intMethod · 0.80
digestMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…