- substr: documentation ( source)
- hash: documentation ( source)
- hexdec: documentation ( source)
<?php
$server_seed = "";
$lotto = "1016171938";
$round_id = "11897";
$hash = hash("sha256",$server_seed."-".$lotto."-".$round_id);
$roll = hexdec(substr($hash,0,8)) % 15;
// Print værdien af $hash
print("\$hash = $hash</br>");
// Prifdec(856672a7) = ".(String)hexdec(substr($hash,0,8))."</br>");
// Print værdien af 856672a7 % 15
print("2238083751 % 15 = ".(2238083751 % 15)."</br>");
// Print værdien af roll
print("\$roll = $roll");
?>