Open Source · MIT License

IDs engineered
for speed & order

Fast, time-sortable, 21-character Base58 unique IDs you can actually read, copy, and work with. For JavaScript, Python, and Rust.

npm install sparkid
1ogVp65qEuNUygJHecWi9
1ogVp65w9A5syaUxXuQvh
1ogVp65w9A5sybUGyUfuc

Anatomy of a SparkID

Every SparkID packs a millisecond-precision timestamp, a monotonic counter, and cryptographic randomness into 21 Base58 characters.

1ogVp65q
Timestamp 8 chars · ms since epoch
EuNUyg
Counter 6 chars · monotonic
JHecWi9
Random 7 chars · CSPRNG
Sortable

Lexicographic string comparison preserves temporal order

Monotonic

Counter ensures strict ordering even at sub-millisecond throughput

🔒
Collision-resistant

~8.4 × 10²² unique values per millisecond from 13 Base58 characters of entropy

Compare what matters

sparkid gives you the best of every world — compact, sortable, monotonic, fast, and with zero dependencies.

sparkid UUID v4 UUID v7 nanoid ULID
Length 21 36 36 21 26
Sortable
Monotonic Opt-in Opt-in
URL-safe
Binary repr. 16 bytes 16 bytes 16 bytes 16 bytes
Performance Fastest Moderate Slow Moderate Slow

Three languages, one API

Identical algorithm, idiomatic API. Pick your language and generate SparkIDs in one line.

import { generateId } from "sparkid";

const id = generateId();
// → "1ogVp65qEuNUygJHecWi9"

Blazing fast

Up to 23M SparkIDs/sec in Rust, 8M in JavaScript, 7.5M in Python. Faster than UUID, nanoid, and ULID in every language.

🔤

Human readable

Base58 drops ambiguous characters — no 0/O, no I/l. Double-click to select the whole ID. Read it aloud without confusion. Copy it from a log on the first try.

📦

16-byte binary

Pack any SparkID into 16 bytes for efficient storage. Sort order is preserved — byte comparison matches string comparison.

🧵

Thread & fork safe

Per-thread generators in Python and Rust. Python automatically reseeds on fork() — no stale state in child processes.

🪶

Zero dependencies

JS and Python have no runtime dependencies at all. Rust depends only on rand for the userspace CSPRNG.

🎯

No bias

Random bytes are rejection-sampled to Base58 — never modulo. Uniform distribution across the full output space.

Measured, not claimed

Median throughput. Higher is better. sparkid leads in every language.

JavaScript

sparkid
8.2M
UUID v4
4.5M
nanoid
3.9M
ulid
2.9M
UUID v7
1.7M

Python

sparkid
7.5M
UUID v4
370K
UUID v7
275K
nanoid
232K
ulid
172K

Rust

sparkid
23.2M
ulid
16.0M
UUID v4
1.4M
UUID v7
1.3M
nanoid
1.2M

Median IDs/second · Higher is better · Run it yourself

Start generating

Install sparkid in your language of choice and generate your first SparkID in seconds.