- substr: documentation ( source)
- hash: documentation ( source)
- hexdec: documentation ( source)
<?php
$server_seed = "wD1Npmkxz0pTsHXNLojXIoG9DMTxiACRyuHQVkiJCt2wbTR9r8QBfKo1fh8SwhFn";
$public_seed = "676406627421";
$round = "2257";
$hash = hash('sha256', $server_seed . "-" . $public_seed . "-" . $round);
$roll = hexdec(substr($hash, 0, 8)) % 15;
if ($roll == 0) $roll_colour = 'bonus';
elseif ($roll >= 1 and $roll <= 7) $roll_colour = 'orange';
elseif ($roll >= 8 and $roll <= 14) $roll_colour = 'black';
echo("Roll: $roll\nColour: $roll_colour");