Uuid¶
Import: import system.uuid;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
Uuid¶
A 16-byte UUID value; assignment copies bits without allocation or reference counting.
v4¶
Generates a version-4 UUID from the secure random source, preserving entropy failures.
from_bytes¶
Copies exactly 16 bytes in network order into a UUID value.
to_bytes¶
Returns an independent 16-byte array in network order.
parse¶
Parses the canonical 36-character form, such as 123e4567-e89b-12d3-a456-426614174000. Hexadecimal digits may be upper- or lowercase. Fails with ParseError (code EPARSE) for any other length, separator, or digit.
is_valid¶
Tests canonical UUID syntax without generating entropy.
equals¶
Compares all 128 bits, independent of storage identity.
compare¶
Orders UUIDs lexicographically by their unsigned network-order bytes.
hash_code¶
Folds all bits into a stable hash for maps and sets without formatting text.
to_string¶
Returns canonical lowercase text; formatting is the only string allocation.