Struct urandom::rng::Xoshiro256

source ·
pub struct Xoshiro256 { /* private fields */ }
Expand description

This is xoshiro256 1.0, one of our all-purpose, rock-solid generators.

It has excellent (sub-ns) speed, a state (256 bits) that is large enough for any parallel application, and it passes all tests we are aware of.

The state must be seeded so that it is not everywhere zero. If you have a 64-bit seed, we suggest to seed a SplitMix64 generator and use its output to fill s.

Examples

let mut rng = urandom::rng::Xoshiro256::new();
let value: i32 = rng.next();

Implementations

Creates a new instance seeded securely from system entropy.

See the SeedRng trait for more information.

Creates a new PRNG seeded from another Rng.

See the SeedRng trait for more information.

Creates a new PRNG using the given seed.

See the SeedRng trait for more information.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the next u32 in the sequence.
Returns the next u64 in the sequence.
Returns a uniform random f32 in the half-open interval [1.0, 2.0). Read more
Returns a uniform random f64 in the half-open interval [1.0, 2.0). Read more
Fills the next u32 elements in the sequence. Read more
Fills the next u64 elements in the sequence.
Fills the byte slice with uniform random bytes. Read more
Advances the internal state significantly. Read more
Creates a new instance seeded securely from system entropy. Read more
Creates a new PRNG seeded from another Rng. Read more
Creates a new PRNG using the given seed. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.