Struct xoroshiro::rng::SplitMix64 [−][src]
pub struct SplitMix64 { /* fields omitted */ }
A splitmix random number generator.
The splitmix algorithm is not suitable for cryptographic purposes, but is
very fast and has a 64 bit state. Usually XoroShiro128
should be prefered.
If you do not know for sure that it fits your requirements, use a more
secure one such as IsaacRng
or OsRng
.
The algorithm used here is translated from the splitmix64.c
reference source code by
Sebastiano Vigna.
Methods
impl SplitMix64
[src]
impl SplitMix64
pub fn new_unseeded() -> SplitMix64
[src]
pub fn new_unseeded() -> SplitMix64
Creates a new SplitMix64
instance which is not seeded.
The initial values of this RNG are constants, so all generators created
by this function will yield the same stream of random numbers. It is
highly recommended that this is created through SeedableRng
instead of
this function.
pub fn from_seed_u64(seed: u64) -> SplitMix64
[src]
pub fn from_seed_u64(seed: u64) -> SplitMix64
Trait Implementations
impl Debug for SplitMix64
[src]
impl Debug for SplitMix64
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for SplitMix64
[src]
impl Clone for SplitMix64
fn clone(&self) -> SplitMix64
[src]
fn clone(&self) -> SplitMix64
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl RngCore for SplitMix64
[src]
impl RngCore for SplitMix64
fn next_u32(&mut self) -> u32
[src]
fn next_u32(&mut self) -> u32
Return the next random u32
. Read more
fn next_u64(&mut self) -> u64
[src]
fn next_u64(&mut self) -> u64
Return the next random u64
. Read more
fn fill_bytes(&mut self, dest: &mut [u8])
[src]
fn fill_bytes(&mut self, dest: &mut [u8])
Fill dest
with random data. Read more
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>
[src]
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>
Fill dest
entirely with random data. Read more
impl SeedableRng for SplitMix64
[src]
impl SeedableRng for SplitMix64
type Seed = [u8; 8]
Seed type, which is restricted to types mutably-dereferencable as u8
arrays (we recommend [u8; N]
for some N
). Read more
fn from_seed(seed: [u8; 8]) -> SplitMix64
[src]
fn from_seed(seed: [u8; 8]) -> SplitMix64
Create a new SplitMix64
.
fn from_rng<R>(rng: R) -> Result<Self, Error> where
R: RngCore,
[src]
fn from_rng<R>(rng: R) -> Result<Self, Error> where
R: RngCore,
Create a new PRNG seeded from another Rng
. Read more
Auto Trait Implementations
impl Send for SplitMix64
impl Send for SplitMix64
impl Sync for SplitMix64
impl Sync for SplitMix64