ULID Generator for JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
UNLICENSE
test.html
ulid.js

README.md

ULID Library (JavaScript)

This is a browser JavaScript library for generating Universally Unique Lexicographically Sortable Identifiers (ULIDs). With modern browsers on modern hardware, it can generate 1.5 million ULIDs per second.

The API is a single constructor. It constructs a closure that generates monotonic ULIDs each time it's invoked.

let generator = ULID();
let ulid0 = generator();
let ulid1 = generator();
assert(ulid0 < ulid1);

The generator itself makes no allocations when generating ULIDs, except for the returned ULID string.