modules/ulid.zzm

ulid-0.0.2 documentation

Package

Name
ulid
Version
0.0.2
Uploaded
2026-07-30 00:49:32
Repository
https://github.com/tobyink/zuzu-ulid
Dependencies
Metadata
zuzu-distribution.json
Archive
Download .tar.gz

NAME

ulid - Universally Unique Lexicographically Sortable Identifiers.

SYNOPSIS

  from ulid import create_ulid, create_ulid_binary;

  let text := create_ulid();
  let raw := create_ulid_binary();

IMPLEMENTATION SUPPORT

This module is supported by all implementations of ZuzuScript.

DESCRIPTION

This module generates ULIDs using a 48-bit Unix timestamp in milliseconds and 80 bits of cryptographically secure randomness. The text form uses canonical uppercase Crockford Base32.

Identifiers generated within the same millisecond are monotonic: the random component is incremented so that each later identifier sorts after the previous one.

EXPORTS

Functions

  • create_ulid_binary()

    Parameters: none. Returns: BinaryString. Returns a single ULID as 16 raw bytes in network byte order.

  • create_ulid()

    Parameters: none. Returns: String. Returns a single ULID as 26 uppercase Crockford Base32 characters.

COPYRIGHT AND LICENCE

ulid is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.