/snowflake

Prototype snowflake implementation

Primary LanguageGoMIT LicenseMIT

Snowflake

A spike of the snowflake specification.

A snowflake fits in a signed 64-bit integer (63 bits)

  • 41 bit timestamp in seconds since some configured epoch

  • 10 bit instance/shard/worker ID

  • 12 bit sequence number per worker per timestamp

The implementation of bit-packing is currently wrong.

Configuration

The Snowflake Generator requires an epoch and an instance ID to work.

Examples

There’s one basic example at the moment. Run it with the following command.

go run examples/checkSequence.go

To do