picop.uuid#

Fast C-backed UUID values and version 4 generation.

class picop.uuid.UUID#

Bases: UUID

Stdlib-compatible UUID built from canonical text or 16 bytes in C.

Notes

Field layout, str/hex/urn formatting, and comparisons match uuid.UUID. Construction accepts a hyphenated/ canonical string or exactly 16 bytes; invalid input raises ValueError.

int#

Return the 128-bit integer value of the UUID.

is_safe#

Return multiprocessing safety as uuid.SafeUUID.

__eq__(other)#

Return self==value.

__format__(format_spec)#

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__(other)#

Return self>=value.

__gt__(other)#

Return self>value.

__int__()#

Return the 128-bit integer value (same as int).

__le__(other)#

Return self<=value.

__lt__(other)#

Return self<value.

__ne__(other)#

Return self!=value.

__reduce__()#

Helper for pickle.

__repr__()#

Return repr(self).

__str__()#

Return str(self).

property bytes#

Return the 16-byte big-endian binary representation.

property bytes_le#

Return the 16-byte little-endian binary representation.

property clock_seq#

Return the 14-bit clock sequence field.

property clock_seq_hi_variant#

Return the clock_seq_hi_and_reserved field (8 bits).

property clock_seq_low#

Return the clock_seq_low field (8 bits).

property fields#

Return the six RFC 4122 integer fields as a tuple.

property hex#

Return the 32-character hexadecimal form without hyphens.

property node#

Return the 48-bit node (MAC) field.

property time#

Return the 60-bit timestamp field when applicable.

property time_hi_version#

Return the time_hi_and_version field (16 bits).

property time_low#

Return the time_low field (32 bits).

property time_mid#

Return the time_mid field (16 bits).

property urn#

Return the RFC 4122 urn:uuid:… form.

property variant#

Return the UUID variant name string (e.g. specified in RFC 4122).

property version#

Return the UUID version number, or None if not RFC 4122.

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