Crate msws

Source
Expand description

Middle Square Weyl Sequence pseudorandom number generator (no_std).

§Example

use msws::Rand;

// This will always return the same seed.
msws::seed(0); // => 0xb5ad4eceda1ce2a9

let seed = 0xb5ad4eceda1ce2a9;
let mut r = Rand::new(seed).expect("invalid seed");
r.rand(); // => 0xb5ad4ece

§Crypto

Pseudorandom number generators should not be used for crypto.

Structs§

Rand
This struct holds the state necessary to generate random numbers. You should continue to call rand() on the same instance of the struct.

Functions§

seed
Returns a seed for a given integer.