Name

ULID::Tiny - A lightweight ULID (Universally Unique Lexicographically Sortable Identifier) generator

Synopsis

use ULID::Tiny qw(ulid ulid_date);

# Generate a new ULID
my $id = ulid(); # e.g. "01ARZ3NDEKTSV4RRFFQ69G5FAV"

# Generate a ULID with a specific timestamp (milliseconds since epoch)
my $id = ulid(time => 1234567890000);

# Extract the timestamp from a ULID (returns milliseconds since epoch)
my $ms = ulid_date($id);

# Generate a ULID in raw 16-byte binary form
my $bytes = ulid(binary => 1);

Description

ULID::Tiny is a minimal, pure Perl, dependency-light module for generating ULIDs.

https://github.com/ulid/spec

A ULID is a 128-bit identifier consisting of:

Key properties:

Methods

Randomness

The module attempts to use the best available entropy source:

Version

1.0.0

License

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.