On this page
uuid.uuid3
Prev: uuid.uuid1 | Up: uuid | Next: uuid.uuid4
Rel: uuid.bytes_, uuid.Enum, uuid.getnode, uuid.int_
Ref: docs.python.org — uuid.uuid3
Tags: #public #python3 #stdlib #uuid
Import
import uuid
from uuid import uuid3
Signature & Overview
uuid.uuid3(namespace, name)
Generate a UUID from the MD5 hash of a namespace UUID and a name.
Usage
import uuid
u = uuid.uuid3(uuid.NAMESPACE_DNS, 'example.com')
assert u.version == 3 and u == uuid.uuid3(uuid.NAMESPACE_DNS, 'example.com')
Gotchas
- Deterministic MD5 namespace UUID: Prefer
uuid5()(SHA-1) overuuid3()(MD5).
REPL Inspect
from uuid import uuid3
help(uuid3)
Linked from
Related notes
- tuts/python3/stdlib_module/uuid/uuid1 Linked here; links to this page; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/uuid4 Linked here; links to this page; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/bytes_ Linked here; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/Enum Linked here; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/getnode Linked here; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/int_ Linked here; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/UUID Linked here; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/uuid/main shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/SafeUUID shared tags: #stdlib, #uuid