pub struct Xoshiro256StarStar { /* private fields */ }Expand description
Xoshiro256** pseudo-random number generator.
This is the default BitGenerator for ferray-random. It has a period of
2^256 - 1 and supports jump() for parallel generation (each jump
advances the state by 2^128 steps).
§Example
use ferray_random::bitgen::Xoshiro256StarStar;
use ferray_random::bitgen::BitGenerator;
let mut rng = Xoshiro256StarStar::seed_from_u64(42);
let val = rng.next_u64();Trait Implementations§
Source§impl BitGenerator for Xoshiro256StarStar
impl BitGenerator for Xoshiro256StarStar
Source§fn seed_from_u64(seed: u64) -> Self
fn seed_from_u64(seed: u64) -> Self
Create a new generator seeded from a single
u64.Source§fn jump(&mut self) -> Option<()>
fn jump(&mut self) -> Option<()>
Advance the generator state by a large step (2^128 for Xoshiro256**). Read more
Source§fn stream(_seed: u64, _stream_id: u64) -> Option<Self>
fn stream(_seed: u64, _stream_id: u64) -> Option<Self>
Create a new generator from a seed and a stream ID. Read more
Source§fn fill_bytes(&mut self, dest: &mut [u8])
fn fill_bytes(&mut self, dest: &mut [u8])
Fill a byte slice with random bytes.
Source§fn next_u64_bounded(&mut self, bound: u64) -> u64
fn next_u64_bounded(&mut self, bound: u64) -> u64
Generate a
u64 in the range [0, bound) using rejection sampling.Auto Trait Implementations§
impl Freeze for Xoshiro256StarStar
impl RefUnwindSafe for Xoshiro256StarStar
impl Send for Xoshiro256StarStar
impl Sync for Xoshiro256StarStar
impl Unpin for Xoshiro256StarStar
impl UnsafeUnpin for Xoshiro256StarStar
impl UnwindSafe for Xoshiro256StarStar
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