3v4l.org

run code in 500+ PHP versions simultaneously
<?php /* * Fill in all three below and click the blue 'eval();' button. * ------------------ */ $server_seed = ""; $eos_hash = ""; $round_number = ""; /* ------------------ */ if ($server_seed == '' || $eos_hash === "" || $round_number == '') { echo "Fill in details"; return; } // Create HMAC-SHA256 hash $message = $eos_hash . "-" . $round_number; $hmac_hash = hash_hmac('sha256', $message, $server_seed); // Convert hex to decimal using bcmath for large numbers $decimal_value = '0'; $length = strlen($hmac_hash); for ($i = 0; $i < $length; $i++) { $decimal_value = bcmul($decimal_value, '16'); // Multiply by base 16 $decimal_value = bcadd($decimal_value, hexdec($hmac_hash[$i])); // Add the current digit } // Apply modulo 10^8 $jackpot_result = bcmod($decimal_value, '100000000'); // 10^8 = 100000000 echo "Jackpot Round: " . $jackpot_result; ?>
Output for 8.2.31 - 8.2.32, 8.3.0 - 8.3.32, 8.4.1 - 8.4.23, 8.5.0 - 8.5.8
Fill in details

preferences:
54.99 ms | 750 KiB | 4 Q