Skip to main content

Module snowflake

Module snowflake 

Source
Available on crate feature snowflake only.
Expand description

§Snowflake ID generation

Twitter Snowflake-style 64-bit IDs: 41-bit timestamp + 10-bit worker ID + 12-bit sequence number. Distributed-safe when each worker gets a unique ID. Monotonic within a worker.

In 0.1.0 this is a placeholder implementation.

Structs§

Snowflake
Snowflake ID generator.

Constants§

DEFAULT_EPOCH_MS
Default epoch (2026-01-01T00:00:00Z in milliseconds since UNIX epoch).