docs.rs failed to build axess-rng-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
axess-rng
Injectable cryptographically-secure RNG trait for deterministic simulation testing (DST). Foundational primitive used by Axess and adjacent crates.
Production code depends on the SecureRng trait. Tests inject MockRng (a seeded PRNG) for reproducible randomness in auth flows, token issuance, and key generation; the same seed always produces the same byte stream.
Usage
use ;
use Arc;
// Production: pulls from the OS CSPRNG.
let rng: = new;
// Tests: deterministic seed.
let rng: = new;
let mut buf = ;
rng.fill_bytes;
SecureRng::fill_bytes(&self, …) uses interior mutability so Arc<dyn SecureRng> is dyn-compatible. MockRng serialises its seed under std::sync::Mutex so concurrent calls never produce colliding byte streams while single-threaded determinism is preserved.
Licence
Dual-licensed under MIT and Apache-2.0.