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 git.master_jit, git.master
Fill in details

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
42.06 ms | 750 KiB | 4 Q