Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twe4ked/msws
Middle Square Weyl Sequence pseudorandom number generator.
https://github.com/twe4ked/msws
msws no-std rand random rng rust
Last synced: 15 days ago
JSON representation
Middle Square Weyl Sequence pseudorandom number generator.
- Host: GitHub
- URL: https://github.com/twe4ked/msws
- Owner: twe4ked
- Created: 2019-06-25T08:50:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-08T04:15:48.000Z (over 5 years ago)
- Last Synced: 2024-10-19T13:00:45.630Z (2 months ago)
- Topics: msws, no-std, rand, random, rng, rust
- Language: Rust
- Homepage: https://docs.rs/msws/
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Middle Square Weyl Sequence
[Middle Square Weyl Sequence][1] pseudorandom number generator (`no_std`).
[1]: https://en.wikipedia.org/wiki/Middle-square_method#Middle_Square_Weyl_Sequence_PRNG
## Example
```rust
use msws::Rand;// This will always return the same seed.
msws::seed(0); // => 0xb5ad4eceda1ce2a9let seed = 0xb5ad4eceda1ce2a9;
let mut r = Rand::new(seed).expect("invalid seed");
r.rand(); // => 0xb5ad4ece
```## Crypto
Pseudorandom number generators should not be used for crypto.
### License
MIT