pub struct XorShiftRng { /* private fields */ }
Expand description
An Xorshift random number generator.
The Xorshift1 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 StdRng
or OsRng
.
Marsaglia, George (July 2003). “Xorshift RNGs”. Journal of Statistical Software. Vol. 8 (Issue 14). ↩
Trait Implementations§
Source§impl Clone for XorShiftRng
impl Clone for XorShiftRng
Source§fn clone(&self) -> XorShiftRng
fn clone(&self) -> XorShiftRng
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for XorShiftRng
impl Debug for XorShiftRng
Source§impl PartialEq for XorShiftRng
impl PartialEq for XorShiftRng
Source§impl RngCore for XorShiftRng
impl RngCore for XorShiftRng
Source§fn fill_bytes(&mut self, dest: &mut [u8])
fn fill_bytes(&mut self, dest: &mut [u8])
Fill
dest
with random data. Read moreSource§impl SeedableRng for XorShiftRng
impl SeedableRng for XorShiftRng
Source§type Seed = [u8; 16]
type Seed = [u8; 16]
Seed type, which is restricted to types mutably-dereferenceable as
u8
arrays (we recommend [u8; N]
for some N
). Read moreSource§fn from_rng<R: RngCore>(rng: R) -> Result<Self, Error>
fn from_rng<R: RngCore>(rng: R) -> Result<Self, Error>
Create a new PRNG seeded from another
Rng
. Read moreSource§fn seed_from_u64(state: u64) -> Self
fn seed_from_u64(state: u64) -> Self
Create a new PRNG using a
u64
seed. Read moreSource§fn from_entropy() -> Self
fn from_entropy() -> Self
impl Eq for XorShiftRng
impl StructuralPartialEq for XorShiftRng
Auto Trait Implementations§
impl Freeze for XorShiftRng
impl RefUnwindSafe for XorShiftRng
impl Send for XorShiftRng
impl Sync for XorShiftRng
impl Unpin for XorShiftRng
impl UnwindSafe for XorShiftRng
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