3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hash_pbkdf2_reg($a = 'sha256', $password, $salt, $rounds = 5000, $key_length = 32, $raw_output = false) { // Derived key $dk = ''; // Create key for ($block=1; $block<=$key_length; $block++) { // Initial hash for this block $ib = $h = hash_hmac($a, $salt . pack('N', $block), $password, true); // Perform block iterations for ($i=1; $i<$rounds; $i++) { // XOR each iteration $ib ^= ($h = hash_hmac($a, $h, $password, true)); } // Append iterated block $dk .= $ib; } // Return derived key of correct length $key = substr($dk, 0, $key_length); return $raw_output ? $key : base64_encode($key); } $salt = '1234567890123456'; $iterations = 200000; $length = 256; $hash1 = hash_pbkdf2_reg('sha256', 'plnlrtfpijpuhqylxbgqiiyipieyxvfsavzgxbbcfusqkozwpngsyejqlmjsytrmd', $salt, $iterations, $length);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uTKa2
function name:  (null)
number of ops:  12
compiled vars:  !0 = $salt, !1 = $iterations, !2 = $length, !3 = $hash1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   ASSIGN                                                   !0, '1234567890123456'
   30     1        ASSIGN                                                   !1, 200000
   31     2        ASSIGN                                                   !2, 256
   32     3        INIT_FCALL                                               'hash_pbkdf2_reg'
          4        SEND_VAL                                                 'sha256'
          5        SEND_VAL                                                 'plnlrtfpijpuhqylxbgqiiyipieyxvfsavzgxbbcfusqkozwpngsyejqlmjsytrmd'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !2
          9        DO_FCALL                                      0  $7      
         10        ASSIGN                                                   !3, $7
         11      > RETURN                                                   1

Function hash_pbkdf2_reg:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 9
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 48
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 24
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 9
Branch analysis from position: 39
Branch analysis from position: 9
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 24
Branch analysis from position: 35
Branch analysis from position: 24
filename:       /in/uTKa2
function name:  hash_pbkdf2_reg
number of ops:  54
compiled vars:  !0 = $a, !1 = $password, !2 = $salt, !3 = $rounds, !4 = $key_length, !5 = $raw_output, !6 = $dk, !7 = $block, !8 = $ib, !9 = $h, !10 = $i, !11 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      'sha256'
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      5000
          4        RECV_INIT                                        !4      32
          5        RECV_INIT                                        !5      <false>
    5     6        ASSIGN                                                   !6, ''
    8     7        ASSIGN                                                   !7, 1
          8      > JMP                                                      ->37
   11     9    >   INIT_FCALL                                               'hash_hmac'
         10        SEND_VAR                                                 !0
         11        INIT_FCALL                                               'pack'
         12        SEND_VAL                                                 'N'
         13        SEND_VAR                                                 !7
         14        DO_ICALL                                         $14     
         15        CONCAT                                           ~15     !2, $14
         16        SEND_VAL                                                 ~15
         17        SEND_VAR                                                 !1
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $16     
         20        ASSIGN                                           ~17     !9, $16
         21        ASSIGN                                                   !8, ~17
   14    22        ASSIGN                                                   !10, 1
         23      > JMP                                                      ->33
   17    24    >   INIT_FCALL                                               'hash_hmac'
         25        SEND_VAR                                                 !0
         26        SEND_VAR                                                 !9
         27        SEND_VAR                                                 !1
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $20     
         30        ASSIGN                                           ~21     !9, $20
         31        ASSIGN_OP                                    11          !8, ~21
   14    32        PRE_INC                                                  !10
         33    >   IS_SMALLER                                               !10, !3
         34      > JMPNZ                                                    ~24, ->24
   21    35    >   ASSIGN_OP                                     8          !6, !8
    8    36        PRE_INC                                                  !7
         37    >   IS_SMALLER_OR_EQUAL                                      !7, !4
         38      > JMPNZ                                                    ~27, ->9
   25    39    >   INIT_FCALL                                               'substr'
         40        SEND_VAR                                                 !6
         41        SEND_VAL                                                 0
         42        SEND_VAR                                                 !4
         43        DO_ICALL                                         $28     
         44        ASSIGN                                                   !11, $28
   26    45      > JMPZ                                                     !5, ->48
         46    >   QM_ASSIGN                                        ~30     !11
         47      > JMP                                                      ->52
         48    >   INIT_FCALL                                               'base64_encode'
         49        SEND_VAR                                                 !11
         50        DO_ICALL                                         $31     
         51        QM_ASSIGN                                        ~30     $31
         52    > > RETURN                                                   ~30
   27    53*     > RETURN                                                   null

End of function hash_pbkdf2_reg

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.25 ms | 1407 KiB | 22 Q