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

Function uuid3

Lib/uuid.py:763–772  ·  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

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

Callers

nothing calls this directly

Calls 5

isinstanceFunction · 0.85
_from_intMethod · 0.80
md5Method · 0.45
from_bytesMethod · 0.45
digestMethod · 0.45

Tested by

no test coverage detected