Struct smolprng::smol_core::PRNG [−][src]
pub struct PRNG<T: Algorithm> { /* fields omitted */ }Expand description
PRNG is the central pseudo-random number generating front end. This is the front end for the enture package.
Implementations
Implementation of the PRNG class over generic trait Algorithm
Can be used in the following ways.
let prng = PRNG{generator: JsfGenerator::default()};
let rand_bool = prng.gen_bool(); // Generates a random bool
let rand_u8 = prng.gen_u8(); //Generates a random u8
let rand_u16 = prng.gen_u16(); //Generates a random u16
let rand_u32 = prng.gen_u32(); //Generates a random u32
let rand_u64 = prng.gen_u64(); //Generates a random u64
let rand_u128 = prng.gen_u128(); //Generates a random u128
let rand_f32 = prng.gen_f32(); //Generates a random f32
let rand_f64 = prng.gen_f64(); //Generates a random f64generates a random unsigned integer of appropriate type from algorithm output
generates a random unsigned integer of appropriate type from algorithm output
generates a random unsigned integer of appropriate type from algorithm output
generates a random unsigned integer of appropriate type from algorithm output