Registry / utility / rand
library0.10.1rscratesunverified

Random number generators and other randomness functionality.

# Cargo.toml [dependencies] rand = "0.10.1"
INSTALL
IMPORT
SIG · RAND
R
rand
utilityrustv0.10.1
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.

Rng
use rand::Rng;

Generates a random u32 using the default thread-local RNG.

use rand::Rng; fn main() { let mut rng = rand::thread_rng(); let n: u32 = rng.gen(); println!("Random u32: {}", n); }
Debug
Known issues
breakingRand 0.10 changed the default RNG algorithm; code using `rand::random()` still works but may have different performance.
fix
Review the 0.10 changelog for breaking changes if upgrading from 0.8 or earlier.
affects: >=0.10.0
Upgrade
Version history
0.10.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
rand — cargo add rand · libregistry