PCG (Permuted Congruential Generator) Pseudo random number generator implementation of C (C99).
This code was created to implement the Random extension in PHP.
It includes an implementation that improves the portability of the original PCG (state: 128-bit, generate: 64-bit) so that it can run on 32-bit platforms.
It aims to be an implementation of Rust's Pcg64 and NumPy's PCG64.
- Not possible to seed with 128-bit values
- Because it is a PoC. PHP implementation allows 128-bit seeding with string.
- Cannot fully testing on
__uint128_tunsupported environment
$ git clone --recursive https://github.com/zeriyoshi/pcg64_example.git "pcg64_example"reference_implementation requires __uint128_t support
$ make all$ make test32$ make testrequires Docker (with QEMU) and docker-compose
$ make docker-test32-allOR
$ make docker-test32 ARCH=<YOUR_ARCH>requires Docker (with QEMU) and docker-compose
$ make docker-test-allOR
$ make dokcer-test ARCH=<YOUR_ARCH>$ make up ARCH=<YOUR_ARCH:arm64v8>
$ make shell
$ make down