@tola/uuid

Normalize UUID strings and generate deterministic UUID v5 identifiers.

Import

typst
#import "@tola/uuid:0.0.0": *

Exports

normalize

typc
let normalize(
  value: str,
) = str;

Format a UUID string as canonical lowercase hyphenated form.

Positional parameters

  • value str required: UUID string: 32 hex digits, hyphenated UUID, braced {...}, or urn:uuid:... (no leading/trailing whitespace).

v5

typc
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

  • namespace str required: Namespace UUID string (same formats as normalize, or one of namespace.*).
  • name str | bytes required: Name as a string (UTF-8 encoded verbatim) or raw bytes.

Derive a deterministic DNS UUID v5

typst
#import "@tola/uuid:0.0.0": namespace, v5

#let id = v5(namespace.dns, "www.example.com")
#document("index.html")[#id]

namespace

typc
namespace: value (defined by package)

Dictionary of standard RFC 4122 namespace UUIDs: dns, url, oid, and x500.

Search this site

Use the arrow keys to move through results.

Type to search.