Download the PHP package lucapuddu/php-provably-fair without Composer
On this page you can find all versions of the php package lucapuddu/php-provably-fair. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lucapuddu/php-provably-fair
More information about lucapuddu/php-provably-fair
Files in lucapuddu/php-provably-fair
Package php-provably-fair
Short Description PhpProvablyFair is a library that generates and verifies provably fair games.
License MIT
Homepage https://github.com/lpuddu/php-provably-fair
Informations about the package php-provably-fair
Php Provably Fair
This library provides functions to generate and verify provably fair games.
Installation
Via Composer
The algorithm
Parameters values used in this example
Steps
-
A hexadecimal string of variable length (depending on the algorithm used) is computed with hash_hmac. The function uses the
$serverSeed
as key, and the$clientSeed
and$nonce
as data, concatenated with an hyphen: -
$output1
is then scaled to a number from0
to1
, by converting it to an integer number and then dividing it by the maximum result possible (which is equal to16 ^ length of $output1
) -
$output2
is scaled accordingly tomin
andmax
: - The result is returned.
Usage
Create a ProvablyFair
Object
Default values
Get the full list of supported algorithms here.
Roll a number
Verify a roll
Security
If you discover any security related issues, please use the issue tracker on github or email me at infoatlucapuddu.com
Authors
License
MIT. Please see the license file for more information.
All versions of php-provably-fair with dependencies
ext-bcmath Version *