uuid
Universally unique identifiers (UUIDs): their versions and their text.
Every UUID version, and any other 128-bit value, is a uuid: they compare as unsigned integers, and their usual
text is 22 Block Base58 characters, which str::format and interpolation produce. Version modules, such as
uuid::v7, make identifiers and read version-specific fields.
Write these names after uuid::, as in uuid::v7.
v7
use mod v7 = "@std/uuid/v7.saka"UUIDv7 generation and timestamps; see @std/uuid/v7.saka.
See uuid::v7.
version
def version(id! uuid)? numReturns the RFC 9562 version number from 0 to 15 of an identifier with the RFC 9562 variant, or an empty Bag for other identifiers, including the Nil and Max UUIDs.
parse
def parse(text! str)? uuidParses canonical 22-character text, or returns an empty Bag for any other text.
hex
def lin hex(id: uuid): strReturns the RFC 9562 hyphenated lowercase hexadecimal spelling, such as 01a0c5d6-a592-726f-b859-283db3c9185e.
parse_hex
def parse_hex(text! str)? uuidParses hyphenated hexadecimal text with digits of either case, or returns an empty Bag for any other text.
of
def lin of(value: ref): uuidReturns the persistent identity of a ref as an identifier.
The identity is the one a host reads and selects by; it never changes, and it is the same on every copy of a
database. Role membership plays no part, so the function accepts any ref.