dkzr/anu-quantum-random-engine 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dkzr/anu-quantum-random-engine

最新稳定版本:v1.1.1

Composer 安装命令:

composer require dkzr/anu-quantum-random-engine

包简介

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

README 文档

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!

Documentation

The \DKZR\ANUQuantumRandomEngine() class takes two parameters:

  1. string $aqn_api_key: Your AQN API key, see AQN pricing.
  2. optional int $length: API requests length of the array to return. Defaults to 1024, must be between 1-1024. See AQN documentation.

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-15