1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! # 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.
pub use crate;
pub use crate;
pub use crateOrionIdError;
pub use crateOrionIdGenerator;
pub use crate;
/// Convenient `Result` alias used throughout the crate.
pub type Result<T> = Result;