velt/random/uuid
API referenceRFC 9562 UUIDs. The text form is lowercase 8-4-4-4-12; the binary form is 16 bytes in network order. For a walkthrough, read the guide.
Exports
s is a UUID in text form with an RFC 9562 version (1-8) and variant, or the nil / max UUID (like the uuid npm package's validate).uuidVersionThe version number (the 13th hex digit) of a well-formed UUID.UuidErrorThrown for malformed UUID text or a byte array that is not 16 bytes long.NIL_UUIDThe all-zero UUID (RFC 9562 §5.9).Re-exported from velt/random/uuid/uuid
function uuidParse(s: string): u8[]The 16 bytes of a UUID in text form (either case). Throws UuidError if malformed.
Re-exported from velt/random/uuid/uuid
function uuidStringify(bytes: u8[]): stringThe lowercase text form of 16 UUID bytes. Throws UuidError for any other length.
Re-exported from velt/random/uuid/uuid
function uuidv4(): stringA random (version 4) UUID.
Re-exported from velt/random/uuid/uuid
function uuidv7(): stringA time-ordered (version 7) UUID: 48-bit Unix milliseconds, then 74 random bits.
Re-exported from velt/random/uuid/uuid
function uuidValidate(s: string): boolWhether s is a UUID in text form with an RFC 9562 version (1-8) and variant, or the
nil / max UUID (like the uuid npm package's validate).
Re-exported from velt/random/uuid/uuid
function uuidVersion(s: string): i64The version number (the 13th hex digit) of a well-formed UUID. Throws UuidError if s is
not a UUID in text form.
Re-exported from velt/random/uuid/errors
class UuidError extends ErrorThrown for malformed UUID text or a byte array that is not 16 bytes long.
constructor(message: string)No doc comment yetRe-exported from velt/random/uuid/uuid
const NIL_UUID = "00000000-0000-0000-0000-000000000000"The all-zero UUID (RFC 9562 §5.9).