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 128-bit lexicographically sortable ULID (`48-bit ms timestamp | 80-bit entropy`).
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Ulid {
    /// Raw big-endian 128-bit ULID integer.
    pub(crate) raw: u128,
}

/// Lock-free monotonic 128-bit ULID generator using atomic state and SplitMix64 entropy.
#[derive(Debug)]
pub struct UlidGenerator {
    /// Packed `(last_ms_48 << 16) | last_rand_hi_16` atomic word.
    pub(crate) hi_state: AtomicU64,
    /// Low 64 bits of the monotonic random suffix.
    pub(crate) lo_state: AtomicU64,
    /// Rolling SplitMix64 entropy seed.
    pub(crate) seed: AtomicU64,
}