pub struct SplitMix64 { /* private fields */ }Expand description
A tiny, fast, deterministic PRNG (Steele et al.’s SplitMix64).
This is not cryptographically secure, but it is excellent for jitter:
it is allocation-free, const-constructible, has good statistical spread,
and is perfectly reproducible from a seed. That reproducibility is the whole
point in P2P/consensus testing.
§Example
use sisyphus::{Jitter, SplitMix64};
let mut a = SplitMix64::new(42);
let mut b = SplitMix64::new(42);
// Same seed => identical stream => reproducible tests.
assert_eq!(a.next_unit_f64(), b.next_unit_f64());Implementations§
Trait Implementations§
Source§impl Clone for SplitMix64
impl Clone for SplitMix64
Source§fn clone(&self) -> SplitMix64
fn clone(&self) -> SplitMix64
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SplitMix64
Source§impl Debug for SplitMix64
impl Debug for SplitMix64
Source§impl Default for SplitMix64
impl Default for SplitMix64
Auto Trait Implementations§
impl Freeze for SplitMix64
impl RefUnwindSafe for SplitMix64
impl Send for SplitMix64
impl Sync for SplitMix64
impl Unpin for SplitMix64
impl UnsafeUnpin for SplitMix64
impl UnwindSafe for SplitMix64
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more