MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / uuid5

Function uuid5

tools/python-3.11.9-amd64/Lib/uuid.py:725–729  ·  view source on GitHub ↗

Generate a UUID from the SHA-1 hash of a namespace UUID and a name.

(namespace, name)

Source from the content-addressed store, hash-verified

723 return UUID(bytes=os.urandom(16), version=4)
724
725def uuid5(namespace, name):
726 """Generate a UUID from the SHA-1 hash of a namespace UUID and a name."""
727 from hashlib import sha1
728 hash = sha1(namespace.bytes + bytes(name, "utf-8")).digest()
729 return UUID(bytes=hash[:16], version=5)
730
731# The following standard UUIDs are for use with uuid3() or uuid5().
732

Callers

nothing calls this directly

Calls 2

UUIDClass · 0.85
digestMethod · 0.80

Tested by

no test coverage detected