On this page
uuid.uuid1
Prev: uuid.UUID | Up: uuid | Next: uuid.uuid3
Rel: uuid.bytes_, uuid.Enum, uuid.getnode, uuid.int_
Ref: docs.python.org — uuid.uuid1
Tags: #public #python3 #stdlib #uuid
Import
import uuid
from uuid import uuid1
Signature & Overview
uuid.uuid1(node=None, clock_seq=None)
Generate a UUID from a host ID, sequence number, and the current time.
Usage
import uuid
u = uuid.uuid1()
assert u.version == 1
Gotchas
- Leaks host MAC address and creation timestamp: Use
uuid4()(random) oruuid7()(Python 3.14+, time-ordered without MAC) instead.
REPL Inspect
from uuid import uuid1
help(uuid1)
Linked from
Related notes
- tuts/python3/stdlib_module/uuid/UUID Linked here; links to this page; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/uuid3 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 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
- tuts/python3/stdlib_module/uuid/uuid4 shared tags: #stdlib, #uuid