What this does
Generate KSUID values (K-Sortable Unique IDs, originally from Segment) in bulk, or paste one to read its timestamp and payload.
Layout
- 4 bytes: seconds since the KSUID epoch, 2014-05-13T16:53:20Z (Unix time 1400000000).
- 16 bytes: random payload from the browser's secure random source.
- The 20 bytes are written as 27 base62 characters (
0-9A-Za-z), padded with leading zeros.
Base62 with a fixed width keeps KSUIDs sortable as plain strings, so they order by creation second in a database index.
Example
0ujtsYcgvSTl8PAuAdqWYSMnLOv decodes to 2017-10-10T04:00:47.000Zwith payload B5A1CD34B5F99D1154FB6853345C9735.
Limits
The timestamp has one-second resolution and a 32-bit range, which runs out in the year 2150. The millisecond variant (KSUIDMS) is not supported.
Privacy
Everything runs in your browser. Nothing is uploaded or stored.