What a Snowflake ID is
Snowflake is a family of fixed-width binary identifiers built for distributed systems: chronologically sortable, locally unique without coordination, and small enough to use as a primary key. Six variants trade size for capability — from a 64-bit embedded ID to a 128-bit form that carries its own geographic routing hint and node signature.
- Fixed-width — no variable-length parsing
- Time-ordered — sorts correctly as bytes, no decoding needed
- Locally unique — node + sequence, no central allocator
- Route-aware — an optional embedded geohash/shard prefix
- Node-authentic — HMAC-derived node identity, not a random UUID segment
- Integrity-checked — parity or CRC in every variant
Pick a width
Bar length is proportional to bit width. Select a row for its field layout, bit math, and a worked example.
Text encodings
Raw Snowflakes are binary. For logs, URLs, and human transcription, encode them as Base32, Base58, or a radix-aligned custom form.
| Encoding | Alphabet | Example | Best for |
|---|---|---|---|
| Base32 (Crockford) | 0–9, A–Z (excl. I L O U) | SF1-9Q8YY-ABCD | Human transcription — no ambiguous characters |
| Base58 (BTC-style) | 1–9 A–H J–N P–Z a–k m–z | 3bDA92D4… | Compact URLs and short IDs |
| Radix32 (custom) | Extended symbol set | 9Q8YY-2025-AB | Aligns cleanly to 5-bit field boundaries |
Base32 encodes 5-bit chunks, so encoded length is ⌈bits ÷ 5⌉
characters — a full SF128 payload runs 26 Base32 characters before punctuation.
Decoding an SF128-GS identifier
Same byte-to-field coloring as the hero. This is a real, bit-accurate 128-bit value:
from snowflake import SF128 sf = SF128.new(timestamp, geohash, node_id, seq) encoded = sf.encode()
let sf = Snowflake::new( timestamp_mjd_us(), geohash_prefix(), hmac_node_id(key, nonce), seq_or_checksum(), ); let bytes = sf.to_bytes();
SELECT (id >> 88) AS mjd_us, ((id >> 64) & x'FFFFFF') AS node_id FROM snowflakes;
The same 128 bits, four symbologies
These aren’t mockups — they’re real output from this project’s own encoder,
each one independently scannable with commodity readers. Same payload as the
worked example above:
5300010003bda92d41a73cc9f0a1427f.
Built to compress
SF128-LOG trades the geo/HMAC fields for a lower-entropy layout — host delta, service ID, relative timestamp offset, counter, parity — tuned for log ingest where every byte is repeated across millions of lines.
| Source | Size | gzip | Parquet | MsgPack |
|---|---|---|---|---|
| ASCII log (ISO ts + hostname) | 64 B | 28 B | 22 B | 20 B |
| Binary SF128-LOG | 16 B | 12 B | 10 B | 9 B |