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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)