uuid+x86_64 +linux
uuid: RFC 9562-compatible Univerally Unique IDentifiers.
This module only generates UUID4, aka "truly random" UUIDs, due to privacy concerns.
Index
Types
type uuid;
Errors
type invalid;
Constants
def UUID_LEN: size = 16; def UUID_STRLEN: size = 36; def UUID_URILEN: size = 45;
Globals
const nil: uuid;
Functions
fn compare(a: uuid, b: uuid) bool; fn decode(in: io::handle) (uuid | invalid | io::error); fn decodestr(in: str) (uuid | invalid); fn encode(out: io::handle, in: uuid) (size | io::error); fn encodestr(in: uuid) str; fn encodeuri(in: uuid) str; fn generate() uuid; fn uri(out: io::handle, in: uuid) (size | io::error);
Types
type uuid[permalink] [source]
type uuid = [16]u8;
A UUID.
Errors
type invalid[permalink] [source]
type invalid = !void;
Returned from decode if an invalid UUID is observed.
Constants
def UUID_LEN[permalink] [source]
def UUID_LEN: size = 16;
The length of a UUID in bytes.
def UUID_STRLEN[permalink] [source]
def UUID_STRLEN: size = 36;
The length of a UUID in runes when encoded as a string.
def UUID_URILEN[permalink] [source]
def UUID_URILEN: size = 45;
The length of the return value of uri in runes.
Globals
let nil[permalink] [source]
const nil: uuid;
The "nil" UUID, with all bits set to zero.
Functions
fn compare[permalink] [source]
fn compare(a: uuid, b: uuid) bool;
Returns true if two UUIDs are equal.
fn decode[permalink] [source]
fn decode(in: io::handle) (uuid | invalid | io::error);
Decodes a UUID as a string from an io::handle.
fn decodestr[permalink] [source]
fn decodestr(in: str) (uuid | invalid);
Decodes a UUID from a string.
fn encode[permalink] [source]
fn encode(out: io::handle, in: uuid) (size | io::error);
Encodes a UUID as a string and writes it to an I/O handle.
fn encodestr[permalink] [source]
fn encodestr(in: uuid) str;
Encodes a UUID as a string. The return value is statically allocated, the caller must use strings::dup to extend its lifetime.
fn encodeuri[permalink] [source]
fn encodeuri(in: uuid) str;
Encodes a UUID as a string. The return value is statically allocated, the caller must use strings::dup to extend its lifetime.
fn generate[permalink] [source]
fn generate() uuid;
Generates a new version 4 UUID.
fn uri[permalink] [source]
fn uri(out: io::handle, in: uuid) (size | io::error);
Encodes a UUID as a URI and writes it to an I/O handle.