Crates.io | msws |
lib.rs | msws |
version | 0.2.0 |
source | src |
created_at | 2019-06-25 08:48:40.044718 |
updated_at | 2019-09-08 04:04:22.607958 |
description | Middle Square Weyl Sequence pseudorandom number generator. |
homepage | |
repository | https://github.com/twe4ked/msws |
max_upload_size | |
id | 143417 |
size | 6,585 |
Middle Square Weyl Sequence pseudorandom number generator (no_std
).
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
Pseudorandom number generators should not be used for crypto.
MIT