Uuid#
Added in version 0.78.
- class Uuid(*args, **kwargs)#
An object representing an UUID.
Constructors#
- class Uuid
- classmethod new_from_string(str: str, len: int, fmt: UuidFormat) Uuid | None#
Creates a new UUID from its string representation
str.Added in version 0.78.
- Parameters:
str – a string
len – the length of
str, or -1 isstris NUL terminatedfmt – flags from
UuidFormatfor which fmt(s) to accept
Methods#
- class Uuid
-
- equal(other: Uuid) bool#
Compares
uuidandotherfor equality.Added in version 0.78.
- Parameters:
other
- free_to_string(fmt: UuidFormat, len: int) str#
Frees
uuidand returns its string representation, seeto_string()for more information.Added in version 0.78.
- Parameters:
fmt – a
UuidFormatlen – a location to store the length of the returned string, or
None
- new_v5(data: str, len: int) Uuid#
Creates a new UUID for
nsandstr.Added in version 0.78.
- Parameters:
data – string data
len – the length of
data, or -1 ifstris NUL terminated
- to_string(fmt: UuidFormat) tuple[str, int]#
Returns the string representation of
uuid.Added in version 0.78.
- Parameters:
fmt – a
UuidFormat
- classmethod validate_string(str: str, len: int, fmt: UuidFormat) bool#
Checks whether
stris a valid string representation of an UUID.Added in version 0.78.
- Parameters:
str – a string
len – the length of
str, or -1 isstris NUL terminatedfmt – a
UuidFormat