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
.
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.
impl Rng for XorShiftRng
fn next(&mut self) -> u32
Return the next random integer
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).