picop.uuid
Fast C-backed UUID values and version 4 generation.
-
class picop.uuid.UUID
Bases: UUID
A fast C-backed UUID value.
-
int
Return the 128-bit integer value of the UUID.
-
is_safe
Return multiprocessing safety as uuid.SafeUUID.
-
__format__(format_spec)
Default object formatter.
Return str(self) if format_spec is empty. Raise TypeError otherwise.
- Parameters:
format_spec (str)
- Return type:
str
-
__reduce__()
Helper for pickle.
- Return type:
tuple[type[UUID], tuple[bytes]]
-
bytes
Return the 16-byte big-endian binary representation.
- Type:
bytes
-
bytes_le
Return the 16-byte little-endian binary representation.
- Type:
bytes
-
clock_seq
Return the 14-bit clock sequence field.
- Type:
int
-
clock_seq_hi_variant
Return the clock_seq_hi_and_reserved field (8 bits).
- Type:
int
-
clock_seq_low
Return the clock_seq_low field (8 bits).
- Type:
int
-
fields
Return the six RFC 4122 integer fields as a tuple.
- Type:
tuple[int, int, int, int, int, int]
-
hex
Return the 32-character hexadecimal form without hyphens.
- Type:
str
-
node
Return the 48-bit node (MAC) field.
- Type:
int
-
time
Return the 60-bit timestamp field when applicable.
- Type:
int
-
time_hi_version
Return the time_hi_and_version field (16 bits).
- Type:
int
-
time_low
Return the time_low field (32 bits).
- Type:
int
-
time_mid
Return the time_mid field (16 bits).
- Type:
int
-
urn
Return the RFC 4122 urn:uuid:… form.
- Type:
str
-
variant
Return the UUID variant name string (e.g. specified in RFC 4122).
- Type:
str
-
version
Return the UUID version number, or None if not RFC 4122.
- Type:
int | None
-
picop.uuid.uuid4()
Return a random version 4 UUID.
- Return type:
UUID
-
picop.uuid.uuid4_bytes()
Return 16 random bytes with UUID v4 and RFC variant bits set.
- Return type:
bytes