@tola/uuid
Normalize UUID strings and generate deterministic UUID v5 identifiers.
Import
#import "@tola/uuid:0.0.0": *Exports
normalize
let normalize(
value: str,
) = str;Format a UUID string as canonical lowercase hyphenated form.
Positional parameters
valuestrrequired: UUID string: 32 hex digits, hyphenated UUID, braced{...}, orurn:uuid:...(no leading/trailing whitespace).
v5
let v5(
namespace: str,
name: str | bytes,
) = str;Generate a deterministic RFC 4122 UUID v5 from a namespace UUID and a name.
Identical (namespace, name) pairs always yield the same UUID. If you need a feed entry ID to remain stable after a page moves, save the generated UUID in metadata rather than recomputing it from the path.
Positional parameters
namespacestrrequired: Namespace UUID string (same formats asnormalize, or one ofnamespace.*).namestr | bytesrequired: Name as a string (UTF-8 encoded verbatim) or rawbytes.
Derive a deterministic DNS UUID v5
#import "@tola/uuid:0.0.0": namespace, v5
#let id = v5(namespace.dns, "www.example.com")
#document("index.html")[#id]namespace
namespace: value (defined by package)Dictionary of standard RFC 4122 namespace UUIDs: dns, url, oid, and x500.