Enhance documentation with usage examples for random number generation utilities

This commit is contained in:
Palash Tyagi
2025-08-03 16:45:00 +01:00
parent f99f78d508
commit 18b9eef063
5 changed files with 49 additions and 0 deletions

View File

@@ -1,3 +1,13 @@
//! Cryptographically secure random number generator.
//!
//! On Unix systems this reads from `/dev/urandom`; on Windows it uses the
//! system's preferred CNG provider.
//!
//! ```
//! use rustframe::random::{crypto_rng, Rng};
//! let mut rng = crypto_rng();
//! let _v = rng.next_u64();
//! ```
#[cfg(unix)]
use std::{fs::File, io::Read};