wire / identifier /
ksuid
KSUID (K-Sortable Unique Identifier) A KSUID is a 160-bit identifier: a 32-bit Unix timestamp (in seconds, offset to a 2014-05-13 epoch) followed by a 128-bit random payload, rendered as 27 characters of base62. The timestamp prefix makes KSUIDs roughly time-sortable, and the 32-bit second-resolution epoch offset buys over a century of range. Created by Segment.
identifier kind identifier status de-facto verification verified tier B identifier@1
aka: K-Sortable Unique Identifier · Segment KSUID
identifier spec: KSUID (github.com/segmentio/ksuid)
length 160 bits sortable base62 (0-9 A-Z a-z), fixed 27 characters
example:
0ujtsYcgvSTl8PAuAdqWYSMnLOv⧉ copy
field bits meaning timestamp 32 Unix UTC seconds MINUS the KSUID epoch offset 1400000000 (2014-05-13 16:53:20 UTC). payload 128 Cryptographically random payload.
20 bytes binary (4-byte timestamp + 16-byte payload) -> always 27 base62 characters, fixed width and lexicographically sortable by timestamp. Epoch offset: KSUID timestamp = unix_seconds - 1400000000, shifting the usable range to ~2014..2150 instead of wasting the low values. Second resolution (coarser than ULID/UUIDv7's millisecond), so ordering within the same second relies on the random payload (not strictly monotonic). Example 0ujtsYcgvSTl8PAuAdqWYSMnLOv is the README sample (timestamp 107608047 -> 2017-10-09, payload B5A1CD34B5F99D1154FB6853345C9735).
agent: curl -H 'accept: application/json' wire.phall.io/identifier/ksuid⧉ copy
or /identifier/ksuid.json ⧉ copy
wire.phall.io ⌘K search main ✓