mod-rand 0.1.0

Tiered random number generation for Rust. Fast PRNG, process-unique seeds, and OS-backed cryptographic random in one zero-dependency library. Pick the tier appropriate to your threat model.
Documentation
//! Minimal example: show each tier in action.
//!
//! Run with: `cargo run --example basic`

use mod_rand::tier1::Xoshiro256;

fn main() {
    // Tier 1: deterministic PRNG.
    println!("Tier 1 — xoshiro256**");
    let mut rng = Xoshiro256::seed_from_u64(42);
    for _ in 0..3 {
        println!("  {:#x}", rng.next_u64());
    }

    #[cfg(feature = "tier2")]
    {
        println!("\nTier 2 — process-unique");
        for _ in 0..3 {
            println!("  {}", mod_rand::tier2::unique_name(12));
        }
    }

    #[cfg(feature = "tier3")]
    {
        println!("\nTier 3 — cryptographic");
        for _ in 0..3 {
            println!("  {}", mod_rand::tier3::random_hex(16).unwrap());
        }
    }
}