Decode and generate Snowflake IDs — 64-bit identifiers used by Twitter, Discord, Instagram, Sony, and more. Extract timestamp, worker, and sequence components.
A Snowflake ID is a 64-bit integer first used by Twitter for distributed unique-ID generation. The layout (most significant bit → least): 1 unused sign bit, 41 bits of milliseconds since a custom epoch, 10 bits of worker/machine ID (5 datacenter + 5 worker for Twitter, or a combined ID), and 12 bits of a per-millisecond sequence. Because time is in the high bits, IDs are roughly monotonic. Different services use different epochs — Twitter: 2010-11-04, Discord: 2015-01-01, Instagram: 2011-08-24.