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.
There’s one basic example at the moment. Run it with the following command.
go run examples/checkSequence.go
-
Handle JSON representation. See this article.