atomic-snowflake 11.1.0

Zero-dependency lock-free monotonic 64-bit Snowflake ID, 128-bit ULID, and RFC 9562 UUIDv7 generators with stack-buffered Crockford Base32 and hyphenated hex codecs.
Documentation
use super::*;

/// A 64-bit time-ordered Snowflake identifier (`[0 | 41-bit ts | 10-bit node | 12-bit seq]`).
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SnowflakeId {
    /// Raw 64-bit encoded Snowflake value.
    pub(crate) raw: u64,
}

/// Lock-free monotonic 64-bit Snowflake ID generator safe for multi-threaded sharing.
#[derive(Debug)]
pub struct SnowflakeGenerator {
    /// Custom Unix epoch in milliseconds subtracted from wall-clock time.
    pub(crate) epoch_ms: u64,
    /// Fixed 10-bit node identifier (`0..=1023`).
    pub(crate) node_id: u16,
    /// Packed `(last_relative_ms << 12) | last_sequence` atomic state.
    pub(crate) state: AtomicU64,
}