rustflake
Thread-safe "twitter" snowflakes.
By default the original Twitter snowflake format defines:
- 41 bits are used to store a custom epoch with millisecond precision
- 10 bits are used to store worker and datacenter information
- 12 bits are used to store a sequence number
This crate lets you customize your own epoch and worker/datacenter information.
Usage
Add this to your Cargo.toml
:
[]
= "0.1.0"
and this to your crate root:
use rustflake;
Example
use Snowflake;
use Snowflake;
use Snowflake;