o192 0.2.2

ORION-192: ordered, resilient, independent, URL-safe 192-bit IDs for distributed systems.
Documentation
//! # ORION-192
//!
//! Rust reference implementation of the **ORION-192** distributed
//! identifier algorithm — **O**rdered, **R**esilient, **I**ndependent,
//! **O**paque-ish, **N**on-coordinated 192-bit identifiers for
//! distributed systems.
//!
//! ## Quick start
//!
//! ```
//! use o192::OrionIdGenerator;
//!
//! let mut gen = OrionIdGenerator::new();
//! let a = gen.next().expect("CSPRNG should succeed");
//! let b = gen.next().expect("CSPRNG should succeed");
//! assert!(a < b, "IDs from one generator are strictly monotonic");
//! ```
//!
//! ## Cross-language compatibility
//!
//! This crate is wire-compatible with the JavaScript / TypeScript and
//! Python implementations published in the same repository. All three
//! implementations pass the shared conformance vectors at
//! `vectors/orion192.vectors.json`.
//!
//! ## Cargo features
//!
//! - `serde` — enables `serde::{Serialize, Deserialize}` for the public
//!   types ([`ParsedOrionId`], [`OrionIdError`]). Disabled by default.
//!
//! ## Specification
//!
//! See [`SPEC.md`](https://github.com/lh0x00/orion-192/blob/main/SPEC.md)
//! for the normative algorithm and wire-format definition.

#![doc(html_root_url = "https://docs.rs/o192/0.1.0")]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![forbid(unsafe_code)]
#![warn(missing_docs)]

mod alphabet;
mod clock;
mod codec;
mod error;
mod generator;
mod parse;
mod random;

pub use crate::alphabet::{
    ALPHABET, DEFAULT_RANDOM_POOL_BYTES, ID_SIZE_BYTES, ID_SIZE_CHARS, MAX_COUNTER,
    MAX_RANDOM_POOL_BYTES, MAX_RELATIVE_MS, MIN_RANDOM_POOL_BYTES, RANDOM_SIZE_BYTES,
};
pub use crate::codec::{decode_sortable64, encode_sortable64};
pub use crate::error::OrionIdError;
pub use crate::generator::OrionIdGenerator;
pub use crate::parse::{is_valid, parse, ParsedOrionId};

/// Convenient `Result` alias used throughout the crate.
pub type Result<T> = core::result::Result<T, OrionIdError>;