https://github.com/hxtree/pseudorandom
A library collection of pseudorandom number generator (PRNG), also known as a deterministic random bit generator (DRBG), used for generating a sequence of numbers whose properties approximate the properties of sequences of random numbers.
https://github.com/hxtree/pseudorandom
Last synced: about 2 months ago
JSON representation
A library collection of pseudorandom number generator (PRNG), also known as a deterministic random bit generator (DRBG), used for generating a sequence of numbers whose properties approximate the properties of sequences of random numbers.
- Host: GitHub
- URL: https://github.com/hxtree/pseudorandom
- Owner: hxtree
- Created: 2021-10-05T05:18:21.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-12T23:07:03.000Z (over 3 years ago)
- Last Synced: 2025-02-12T10:34:41.062Z (3 months ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pseudorandom number generator
A library collection of pseudorandom number generator (PRNG), also known as a deterministic random bit
generator (DRBG), used for generating a sequence of numbers whose properties approximate the properties of sequences of
random numbers.## FisherYatesShuffle
Although the exact collision point varies based on random, using 10 digits a repeat was encountered after 2766 iterations.
```
run($string);
echo $string . PHP_EOL;
if(in_array($string, $bank)){
die('Repeat found after ' . count($bank));
}
$bank[] = $string;
}```
## Basic Usage
```
git clone https://github.com/hxtree/pseudorandom.git
docker build --target test --tag pseudorandom:latest -f Dockerfile .
docker run -it --mount type=bind,source="$(pwd)"/,target=/application/ pseudorandom:latest php tests/FisherYatesShuffle.php
```