igilham / snowflake

Prototype snowflake implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Prototype snowflake implementation

License:MIT License


Languages

Language:Go 100.0%