Registry / crypto / rand-os

rand-os

JSON →
library0.2.2rscratesunverified

OS backed Random Number Generator.

# Cargo.toml [dependencies] rand_os = "0.2.2"
INSTALL
IMPORT
SIG · RAND-OS
R
rand-os
cryptorustv0.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OsRng
use rand_os::OsRng;

Generates a random 32-bit integer using the OS entropy source.

use rand_os::OsRng; use rand_core::RngCore; fn main() { let mut rng = OsRng::new().unwrap(); let random_u32 = rng.next_u32(); println!("Random u32: {}", random_u32); }
Debug
Known issues
breaking`rand_os` is deprecated in favor of `rand::rngs::OsRng` from the `rand` crate.
fix
Use `use rand::rngs::OsRng;` and add `rand` to your dependencies.
affects: >=0.2.0
Upgrade
Version history
0.2.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Amazon
1
Resources
rand-os — cargo add rand-os · libregistry