o192 0.2.2

ORION-192: ordered, resilient, independent, URL-safe 192-bit IDs for distributed systems.
Documentation
//! Constants and lookup tables for the ORION-192 wire format.
//!
//! These values are normative — they MUST NOT diverge from
//! [`SPEC.md`](https://github.com/lh0x00/orion-192/blob/main/SPEC.md).

/// The sortable64 alphabet used by ORION-192.
///
/// Ordered strictly by ASCII codepoint so that bytewise lexicographic
/// ordering of fixed-width encoded strings preserves binary numeric
/// ordering of the underlying 192-bit value.
pub const ALPHABET: &str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~";

/// Size in bytes of an ORION-192 binary identifier.
pub const ID_SIZE_BYTES: usize = 24;

/// Size in characters of the canonical ORION-192 string.
pub const ID_SIZE_CHARS: usize = 32;

/// Size in bytes of the cryptographic random tail.
pub const RANDOM_SIZE_BYTES: usize = 14;

/// Default CSPRNG pool size in bytes.
pub const DEFAULT_RANDOM_POOL_BYTES: usize = 65_536;

/// Hard lower bound on the random pool (must fit one random tail).
pub const MIN_RANDOM_POOL_BYTES: usize = RANDOM_SIZE_BYTES;

/// Hard upper bound on the random pool: 16 MiB.
pub const MAX_RANDOM_POOL_BYTES: usize = 16 * 1024 * 1024;

/// Maximum value for the 20-bit per-generator counter.
pub const MAX_COUNTER: u32 = 0x000F_FFFF;

/// Maximum value for the 48-bit `relative_ms` field.
pub const MAX_RELATIVE_MS: u128 = (1u128 << 48) - 1;

/// Nanoseconds per millisecond.
pub(crate) const NS_PER_MS: u128 = 1_000_000;

/// Minimum forward gap (in nanoseconds) between the wall and monotonic
/// clocks before the hybrid clock starts following the wall clock.
pub(crate) const FORWARD_JUMP_NS: u128 = 2 * NS_PER_MS;