https://github.com/doumanash/squares-rnd
Squares RNG: Simple and fast counter based non-crypto random generator
https://github.com/doumanash/squares-rnd
cbrng prng rng squares-rng
Last synced: 7 months ago
JSON representation
Squares RNG: Simple and fast counter based non-crypto random generator
- Host: GitHub
- URL: https://github.com/doumanash/squares-rnd
- Owner: DoumanAsh
- License: bsl-1.0
- Created: 2020-11-02T15:17:33.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-12T07:28:26.000Z (about 2 years ago)
- Last Synced: 2025-03-28T02:48:37.609Z (7 months ago)
- Topics: cbrng, prng, rng, squares-rng
- Language: Rust
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# squares-rnd

[](https://crates.io/crates/squares-rnd)
[](https://docs.rs/crate/squares-rnd/)
Simple and fast counter based non-crypto random generator.
The algorithm is based on `Middle Square Weyl Sequence RNG`.
See [paper](https://arxiv.org/abs/2004.06278v7) for details.
**NOTE**: Not cryptographically secure.
There are several note-worthy properties to the algorithm:
- State is represented by counter, which is incremented to produce new value, hence making
it easy to predict how state would change.
- The code is short and simple, only taking minimum amount of operations to produce uniform output.
- `key` must have close to equal number of zeroes and ones for optimal output.
This crate provides single key for use, to have more download key file [gist](https://gist.githubusercontent.com/DoumanAsh/a57bc65434702d5d7fb88343c65f3145/raw/a9b45f7155c483f689318ee501222e72be0d66ec/keys)