wire / identifier / snowflake-twitter
A Twitter Snowflake is a 64-bit, roughly time-sortable identifier laid out as: 1 unused sign bit, a 41-bit millisecond timestamp offset from a custom epoch (1288834974657 ms, 2010-11-04), a 10-bit machine id (5-bit datacenter + 5-bit worker), and a 12-bit per-millisecond sequence counter. It fits in a signed 64-bit integer and sorts by creation time, which is why it underpins tweet and many other platform ids.
aka: Twitter Snowflake · X Snowflake · snowflake id
spec: Twitter Snowflake (twitter-archive/snowflake)
example:
1541815603606036480
| field | bits | meaning |
|---|---|---|
| sign | 1 | Unused/reserved most-significant bit, always 0 so the value is a non-negative signed int64. |
| timestamp | 41 | Milliseconds since the Twitter epoch 1288834974657 (2010-11-04 01:42:54.657 UTC). |
| datacenter_id | 5 | Datacenter identifier (part of the 10-bit machine id). |
| worker_id | 5 | Worker/machine identifier (the other half of the 10-bit machine id). |
| sequence | 12 | Per-machine counter incremented for each id within the same millisecond (4096 ids/ms/machine). |
per-fact attribution:
agent: curl -H 'accept: application/json' wire.phall.io/identifier/snowflake-twitter
or /identifier/snowflake-twitter.json