Security & CryptoLesson 344Free preview
ULID Generator
This lesson is part of Web Developer Tools · All levels
Summary
ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier written as 26 Crockford Base32 characters. The initial section contains a millisecond timestamp, followed by randomness, so that the ID can be sorted based on the time of manufacture. This property makes ULIDs more database-friendly than the completely random UUIDv4.
Key points
- The ULID consists of 48 bits of timestamp and 80 bits of randomness
- The length of the ULID text is 26 characters Crockford Base32
- ULIDs can be lexicographically sorted by time
- The capital and minor letters are considered the same when decoding
- UUIDv4 is completely random so it doesn't have a built-in timeline.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.