oklog/ulid

Universally Unique Lexicographically Sortable Identifier (ULID) in Go

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 32 minutes ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on September 13th, 2026
Created on December 6th, 2016
Open Issues & Pull Requests: 8 (+0)
GitHub issues: Enabled
Number of forks: 194
Total Stargazers: 5,046 (+0)
Total Subscribers: 37 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 2.0 days
Mean response time: 40.2 days
90th percentile: 116.0 days
Tracked items: 12

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 3
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 946 days
Stale 30+ days: 3
Stale 90+ days: 3

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

ULID is a Go library that generates universally unique lexicographically sortable identifiers.

The library addresses limitations of traditional UUIDs and GUIDs by providing identifiers that combine a millisecond-precision timestamp with random data. ULIDs solve this by encoding 128 bits into a 26-character string using Crockford's base32, ensuring lexicographic sortability so IDs generated later sort after earlier ones. The approach handles monotonic ordering correctly even when multiple IDs are generated within the same millisecond, and the format is URL-safe with no special characters.

Developers should choose this library when building systems that benefit from sortable identifiers, such as databases where insertion order matters or distributed systems requiring natural ordering without additional indexes. The tool suits applications prioritizing compact representation and readability over the standardized UUID format. For simple use cases, the Make helper function provides sensible defaults with process-global pseudo-random entropy and automatic timestamp generation. Advanced users can construct ULIDs with custom timestamps and entropy sources, though this requires careful consideration of concurrency safety and security properties depending on the use case.

The project maintains a straightforward API with two primary construction paths: Make for convenience and New for control. The library includes both string and binary format support, reflecting a port of the JavaScript implementation with additional capabilities. Documentation emphasizes the flexibility of entropy source selection, with guidance on choosing between pseudo-random sources for general use, cryptographically secure entropy for security-sensitive applications, and performance optimization strategies like entropy pooling for high-throughput scenarios.