Struct std::rand::XorShiftRng

pub struct XorShiftRng {
    priv x: u32,
    priv y: u32,
    priv z: u32,
    priv w: u32,
}

An Xorshift random number generator.

The Xorshift algorithm is not suitable for cryptographic purposes but is very fast. If you do not know for sure that it fits your requirements, use a more secure one such as IsaacRng.

Methods

impl XorShiftRng

fn new() -> XorShiftRng

Create an xor shift random number generator with a random seed.

fn new_seeded(x: u32, y: u32, z: u32, w: u32) -> XorShiftRng

Create a random number generator using the specified seed. A generator constructed with a given seed will generate the same sequence of values as all other generators constructed with the same seed.

Trait Implementations

impl Rng for XorShiftRng

fn next(&mut self) -> u32

Return the next random integer