Home

Awesome

Universally Unique Lexicographically Sortable Identifier

A PostgreSQL (pgcrypto) implementation of alizain/ulid based on OK Log's Go port.

Background

A GUID/UUID can be suboptimal for many use-cases because:

A ULID however:

Usage

SELECT generate_ulid(); -- Output: 01D45VGTV648329YZFE7HYVGWC

Specification

Below is the current specification of ULID as implemented in this repository.

Components

Timestamp

Entropy

String Representation

 01AN4Z07BY      79KA1307SR9X4MV3
|----------|    |----------------|
 Timestamp           Entropy
  10 chars           16 chars
   48bits             80bits
   base32             base32