quad-rand
quad-rand
implements pseudo-random generator http://www.pcg-random.org/download.html based on rust atomics.
Compatible with wasm and also no-std compatible.
Basic usage, no dependencies involved:
use quad_rand as qrand;
// seed random
srand;
// get random number from 0 to u32::MAX
let x = rand;
// get random number from given range
let x = gen_range;
assert!;
// gen_range works for most of standard number types
let x: u8 = gen_range;
assert!;
Optional compatibility layer with rand
crate:
use QuadRand;
use SliceRandom;
let mut vec = vec!;
// QuadRand is rand::RngCore implementation, allowing to use all the cool stuff from rand
vec.shuffle;