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; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 47) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 27
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 27
Branch analysis from position: 44
Branch analysis from position: 27
Branch analysis from position: 10
Branch analysis from position: 7
filename:       /in/Xujdq
function name:  (null)
number of ops:  52
compiled vars:  !0 = $server_seed, !1 = $eos_hash, !2 = $round_number, !3 = $message, !4 = $hmac_hash, !5 = $decimal_value, !6 = $length, !7 = $i, !8 = $jackpot_result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                       !0, ''
    6     1        ASSIGN                                                       !1, ''
    7     2        ASSIGN                                                       !2, ''
   10     3        IS_EQUAL                                             ~12     !0, ''
          4      > JMPNZ_EX                                             ~12     ~12, ->7
          5    >   IS_IDENTICAL                                         ~13     !1, ''
          6        BOOL                                                 ~12     ~13
          7    > > JMPNZ_EX                                             ~12     ~12, ->10
          8    >   IS_EQUAL                                             ~14     !2, ''
          9        BOOL                                                 ~12     ~14
         10    > > JMPZ                                                         ~12, ->13
   11    11    >   ECHO                                                         'Fill+in+details'
   12    12      > RETURN                                                       null
   16    13    >   CONCAT                                               ~15     !1, '-'
         14        CONCAT                                               ~16     ~15, !2
         15        ASSIGN                                                       !3, ~16
   17    16        INIT_FCALL                                                   'hash_hmac'
         17        SEND_VAL                                                     'sha256'
         18        SEND_VAR                                                     !3
         19        SEND_VAR                                                     !0
         20        DO_ICALL                                             $18     
         21        ASSIGN                                                       !4, $18
   20    22        ASSIGN                                                       !5, '0'
   21    23        STRLEN                                               ~21     !4
         24        ASSIGN                                                       !6, ~21
   23    25        ASSIGN                                                       !7, 0
         26      > JMP                                                          ->42
   24    27    >   INIT_FCALL_BY_NAME                                           'bcmul'
         28        SEND_VAR_EX                                                  !5
         29        SEND_VAL_EX                                                  '16'
         30        DO_FCALL                                          0  $24     
         31        ASSIGN                                                       !5, $24
   25    32        INIT_FCALL_BY_NAME                                           'bcadd'
         33        SEND_VAR_EX                                                  !5
         34        INIT_FCALL                                                   'hexdec'
         35        FETCH_DIM_R                                          ~26     !4, !7
         36        SEND_VAL                                                     ~26
         37        DO_ICALL                                             $27     
         38        SEND_VAR_NO_REF_EX                                           $27
         39        DO_FCALL                                          0  $28     
         40        ASSIGN                                                       !5, $28
   23    41        PRE_INC                                                      !7
         42    >   IS_SMALLER                                                   !7, !6
         43      > JMPNZ                                                        ~31, ->27
   29    44    >   INIT_FCALL_BY_NAME                                           'bcmod'
         45        SEND_VAR_EX                                                  !5
         46        SEND_VAL_EX                                                  '100000000'
         47        DO_FCALL                                          0  $32     
         48        ASSIGN                                                       !8, $32
   31    49        CONCAT                                               ~34     'Jackpot+Round%3A+', !8
         50        ECHO                                                         ~34
   32    51      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.28 ms | 1446 KiB | 15 Q