dkzr/anu-quantum-random-engine

\Random\Engine implementation using the api.quantumnumbers.anu.edu.au service

v1.1.1 2023-08-15 14:04 UTC

This package is auto-updated.

Last update: 2024-10-30 02:29:08 UTC


README

Based on work by Setrak Balian in Python.

Use the PHPv82+ \Random\Randomizer class with real quantum random numbers from ANU. The default pseudo-random generator is replaced by calls to the ANU API.

ANU API KEY required

Get your API KEY at https://quantumnumbers.anu.edu.au/pricing.

Please note
The free licence currently only allows for 100 requests per month (and 1 request per second).

Usage

$r = new \Random\Randomizer(
    new \DKZR\ANUQuantumRandomEngine( $anu_api_key )
);

echo "Lucky Number: ", $r->getInt(0, 99), "\n";

License

See LICENCE.

Inspiration

A podcast by Hens Zimmerman pointed me to the ANU service and the Python library. Thank you!