3v4l.org

run code in 300+ PHP versions simultaneously
<?php # # Portable PHP password hashing framework. # # Version 0.3 / genuine. # # Written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in # the public domain. Revised in subsequent years, still public domain. # # There's absolutely no warranty. # # The homepage URL for this framework is: # # http://www.openwall.com/phpass/ # # Please be sure to update the Version line if you edit this file in any way. # It is suggested that you leave the main version number intact, but indicate # your project name (after the slash) and add your own revision information. # # Please do not change the "private" password hashing method implemented in # here, thereby making your hashes incompatible. However, if you must, please # change the hash type identifier (the "$P$") to something different. # # Obviously, since this code is in the public domain, the above are not # requirements (there can be none), but merely suggestions. # class PasswordHash { var $itoa64; var $iteration_count_log2; var $portable_hashes; var $random_state; function PasswordHash($iteration_count_log2, $portable_hashes) { $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) $iteration_count_log2 = 8; $this->iteration_count_log2 = $iteration_count_log2; $this->portable_hashes = $portable_hashes; $this->random_state = microtime(); if (function_exists('getmypid')) $this->random_state .= getmypid(); } function get_random_bytes($count) { $output = ''; if (is_readable('/dev/urandom') && ($fh = @fopen('/dev/urandom', 'rb'))) { $output = fread($fh, $count); fclose($fh); } if (strlen($output) < $count) { $output = ''; for ($i = 0; $i < $count; $i += 16) { $this->random_state = md5(microtime() . $this->random_state); $output .= pack('H*', md5($this->random_state)); } $output = substr($output, 0, $count); } return $output; } function encode64($input, $count) { $output = ''; $i = 0; do { $value = ord($input[$i++]); $output .= $this->itoa64[$value & 0x3f]; if ($i < $count) $value |= ord($input[$i]) << 8; $output .= $this->itoa64[($value >> 6) & 0x3f]; if ($i++ >= $count) break; if ($i < $count) $value |= ord($input[$i]) << 16; $output .= $this->itoa64[($value >> 12) & 0x3f]; if ($i++ >= $count) break; $output .= $this->itoa64[($value >> 18) & 0x3f]; } while ($i < $count); return $output; } function gensalt_private($input) { $output = '$P$'; $output .= $this->itoa64[min($this->iteration_count_log2 + ((PHP_VERSION >= '5') ? 5 : 3), 30)]; $output .= $this->encode64($input, 6); return $output; } function crypt_private($password, $setting) { $output = '*0'; if (substr($setting, 0, 2) == $output) $output = '*1'; $id = substr($setting, 0, 3); # We use "$P$", phpBB3 uses "$H$" for the same thing if ($id != '$P$' && $id != '$H$') return $output; $count_log2 = strpos($this->itoa64, $setting[3]); if ($count_log2 < 7 || $count_log2 > 30) return $output; $count = 1 << $count_log2; $salt = substr($setting, 4, 8); if (strlen($salt) != 8) return $output; # We're kind of forced to use MD5 here since it's the only # cryptographic primitive available in all versions of PHP # currently in use. To implement our own low-level crypto # in PHP would result in much worse performance and # consequently in lower iteration counts and hashes that are # quicker to crack (by non-PHP code). if (PHP_VERSION >= '5') { $hash = md5($salt . $password, TRUE); do { $hash = md5($hash . $password, TRUE); } while (--$count); } else { $hash = pack('H*', md5($salt . $password)); do { $hash = pack('H*', md5($hash . $password)); } while (--$count); } $output = substr($setting, 0, 12); $output .= $this->encode64($hash, 16); return $output; } function gensalt_extended($input) { $count_log2 = min($this->iteration_count_log2 + 8, 24); # This should be odd to not reveal weak DES keys, and the # maximum valid value is (2**24 - 1) which is odd anyway. $count = (1 << $count_log2) - 1; $output = '_'; $output .= $this->itoa64[$count & 0x3f]; $output .= $this->itoa64[($count >> 6) & 0x3f]; $output .= $this->itoa64[($count >> 12) & 0x3f]; $output .= $this->itoa64[($count >> 18) & 0x3f]; $output .= $this->encode64($input, 3); return $output; } function gensalt_blowfish($input) { # This one needs to use a different order of characters and a # different encoding scheme from the one in encode64() above. # We care because the last character in our encoded string will # only represent 2 bits. While two known implementations of # bcrypt will happily accept and correct a salt string which # has the 4 unused bits set to non-zero, we do not want to take # chances and we also do not want to waste an additional byte # of entropy. $itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; $output = '$2a$'; $output .= chr(ord('0') + $this->iteration_count_log2 / 10); $output .= chr(ord('0') + $this->iteration_count_log2 % 10); $output .= '$'; $i = 0; do { $c1 = ord($input[$i++]); $output .= $itoa64[$c1 >> 2]; $c1 = ($c1 & 0x03) << 4; if ($i >= 16) { $output .= $itoa64[$c1]; break; } $c2 = ord($input[$i++]); $c1 |= $c2 >> 4; $output .= $itoa64[$c1]; $c1 = ($c2 & 0x0f) << 2; $c2 = ord($input[$i++]); $c1 |= $c2 >> 6; $output .= $itoa64[$c1]; $output .= $itoa64[$c2 & 0x3f]; } while (1); return $output; } function HashPassword($password) { $random = ''; if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) { $random = $this->get_random_bytes(16); $hash = crypt($password, $this->gensalt_blowfish($random)); if (strlen($hash) == 60) return $hash; } if (CRYPT_EXT_DES == 1 && !$this->portable_hashes) { if (strlen($random) < 3) $random = $this->get_random_bytes(3); $hash = crypt($password, $this->gensalt_extended($random)); if (strlen($hash) == 20) return $hash; } if (strlen($random) < 6) $random = $this->get_random_bytes(6); $hash = $this->crypt_private($password, $this->gensalt_private($random)); if (strlen($hash) == 34) return $hash; # Returning '*' on error is safe here, but would _not_ be safe # in a crypt(3)-like function used _both_ for generating new # hashes and for validating passwords against existing hashes. return '*'; } function CheckPassword($password, $stored_hash) { $hash = $this->crypt_private($password, $stored_hash); if ($hash[0] == '*') $hash = crypt($password, $stored_hash); return $hash == $stored_hash; } } $ok = 0; # Try to use stronger but system-specific hashes, with a possible fallback to # the weaker portable hashes. $t_hasher = new PasswordHash(8, FALSE); $correct = 'test12345'; $hash = $t_hasher->HashPassword($correct); print 'Hash: ' . $hash . "\n"; $check = $t_hasher->CheckPassword($correct, $hash); if ($check) $ok++; print "Check correct: '" . $check . "' (should be '1')\n"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/Wpbr3
function name:  (null)
number of ops:  25
compiled vars:  !0 = $ok, !1 = $t_hasher, !2 = $correct, !3 = $hash, !4 = $check
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  254     0  E >   ASSIGN                                                   !0, 0
  258     1        NEW                                              $6      'PasswordHash'
          2        SEND_VAL_EX                                              8
          3        SEND_VAL_EX                                              <false>
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
  260     6        ASSIGN                                                   !2, 'test12345'
  261     7        INIT_METHOD_CALL                                         !1, 'HashPassword'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $10     
         10        ASSIGN                                                   !3, $10
  263    11        CONCAT                                           ~12     'Hash%3A+', !3
         12        CONCAT                                           ~13     ~12, '%0A'
         13        ECHO                                                     ~13
  265    14        INIT_METHOD_CALL                                         !1, 'CheckPassword'
         15        SEND_VAR_EX                                              !2
         16        SEND_VAR_EX                                              !3
         17        DO_FCALL                                      0  $14     
         18        ASSIGN                                                   !4, $14
  266    19      > JMPZ                                                     !4, ->21
         20    >   PRE_INC                                                  !0
  267    21    >   CONCAT                                           ~17     'Check+correct%3A+%27', !4
         22        CONCAT                                           ~18     ~17, '%27+%28should+be+%271%27%29%0A'
         23        ECHO                                                     ~18
  271    24      > RETURN                                                   1

Class PasswordHash:
Function passwordhash:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
Branch analysis from position: 10
Branch analysis from position: 8
filename:       /in/Wpbr3
function name:  PasswordHash
number of ops:  27
compiled vars:  !0 = $iteration_count_log2, !1 = $portable_hashes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   35     2        ASSIGN_OBJ                                               'itoa64'
          3        OP_DATA                                                  '.%2F0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
   37     4        IS_SMALLER                                       ~3      !0, 4
          5      > JMPNZ_EX                                         ~3      ~3, ->8
          6    >   IS_SMALLER                                       ~4      31, !0
          7        BOOL                                             ~3      ~4
          8    > > JMPZ                                                     ~3, ->10
   38     9    >   ASSIGN                                                   !0, 8
   39    10    >   ASSIGN_OBJ                                               'iteration_count_log2'
         11        OP_DATA                                                  !0
   41    12        ASSIGN_OBJ                                               'portable_hashes'
         13        OP_DATA                                                  !1
   43    14        INIT_FCALL                                               'microtime'
         15        DO_ICALL                                         $9      
         16        ASSIGN_OBJ                                               'random_state'
         17        OP_DATA                                                  $9
   44    18        INIT_FCALL                                               'function_exists'
         19        SEND_VAL                                                 'getmypid'
         20        DO_ICALL                                         $10     
         21      > JMPZ                                                     $10, ->26
   45    22    >   INIT_FCALL                                               'getmypid'
         23        DO_ICALL                                         $12     
         24        ASSIGN_OBJ_OP                                 8          'random_state'
         25        OP_DATA                                                  $12
   46    26    > > RETURN                                                   null

End of function passwordhash

Function get_random_bytes:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 23
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 56
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 29
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 29
Branch analysis from position: 50
Branch analysis from position: 29
Branch analysis from position: 56
Branch analysis from position: 23
Branch analysis from position: 14
filename:       /in/Wpbr3
function name:  get_random_bytes
number of ops:  58
compiled vars:  !0 = $count, !1 = $output, !2 = $fh, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   RECV                                             !0      
   50     1        ASSIGN                                                   !1, ''
   51     2        INIT_FCALL                                               'is_readable'
          3        SEND_VAL                                                 '%2Fdev%2Furandom'
          4        DO_ICALL                                         $5      
          5      > JMPZ_EX                                          ~6      $5, ->14
   52     6    >   BEGIN_SILENCE                                    ~7      
          7        INIT_FCALL                                               'fopen'
          8        SEND_VAL                                                 '%2Fdev%2Furandom'
          9        SEND_VAL                                                 'rb'
         10        DO_ICALL                                         $8      
         11        END_SILENCE                                              ~7
         12        ASSIGN                                           ~9      !2, $8
         13        BOOL                                             ~6      ~9
         14    > > JMPZ                                                     ~6, ->23
   53    15    >   INIT_FCALL                                               'fread'
         16        SEND_VAR                                                 !2
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !1, $10
   54    20        INIT_FCALL                                               'fclose'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
   57    23    >   STRLEN                                           ~13     !1
         24        IS_SMALLER                                               ~13, !0
         25      > JMPZ                                                     ~14, ->56
   58    26    >   ASSIGN                                                   !1, ''
   59    27        ASSIGN                                                   !3, 0
         28      > JMP                                                      ->48
   61    29    >   INIT_FCALL                                               'md5'
         30        INIT_FCALL                                               'microtime'
         31        DO_ICALL                                         $18     
         32        FETCH_OBJ_R                                      ~19     'random_state'
         33        CONCAT                                           ~20     $18, ~19
         34        SEND_VAL                                                 ~20
         35        DO_ICALL                                         $21     
   60    36        ASSIGN_OBJ                                               'random_state'
   61    37        OP_DATA                                                  $21
   63    38        INIT_FCALL                                               'pack'
         39        SEND_VAL                                                 'H%2A'
         40        INIT_FCALL                                               'md5'
         41        FETCH_OBJ_R                                      ~22     'random_state'
         42        SEND_VAL                                                 ~22
         43        DO_ICALL                                         $23     
         44        SEND_VAR                                                 $23
         45        DO_ICALL                                         $24     
         46        ASSIGN_OP                                     8          !1, $24
   59    47        ASSIGN_OP                                     1          !3, 16
         48    >   IS_SMALLER                                               !3, !0
         49      > JMPNZ                                                    ~27, ->29
   65    50    >   INIT_FCALL                                               'substr'
         51        SEND_VAR                                                 !1
         52        SEND_VAL                                                 0
         53        SEND_VAR                                                 !0
         54        DO_ICALL                                         $28     
         55        ASSIGN                                                   !1, $28
   68    56    > > RETURN                                                   !1
   69    57*     > RETURN                                                   null

End of function get_random_bytes

Function encode64:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 39
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 48
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 4
Branch analysis from position: 55
Branch analysis from position: 4
Branch analysis from position: 39
Branch analysis from position: 22
filename:       /in/Wpbr3
function name:  encode64
number of ops:  57
compiled vars:  !0 = $input, !1 = $count, !2 = $output, !3 = $i, !4 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   71     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   73     2        ASSIGN                                                   !2, ''
   74     3        ASSIGN                                                   !3, 0
   76     4    >   INIT_FCALL                                               'ord'
          5        POST_INC                                         ~7      !3
          6        FETCH_DIM_R                                      ~8      !0, ~7
          7        SEND_VAL                                                 ~8
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !4, $9
   77    10        BW_AND                                           ~12     !4, 63
         11        FETCH_OBJ_R                                      ~11     'itoa64'
         12        FETCH_DIM_R                                      ~13     ~11, ~12
         13        ASSIGN_OP                                     8          !2, ~13
   78    14        IS_SMALLER                                               !3, !1
         15      > JMPZ                                                     ~15, ->22
   79    16    >   INIT_FCALL                                               'ord'
         17        FETCH_DIM_R                                      ~16     !0, !3
         18        SEND_VAL                                                 ~16
         19        DO_ICALL                                         $17     
         20        SL                                               ~18     $17, 8
         21        ASSIGN_OP                                     9          !4, ~18
   80    22    >   SR                                               ~21     !4, 6
         23        BW_AND                                           ~22     ~21, 63
         24        FETCH_OBJ_R                                      ~20     'itoa64'
         25        FETCH_DIM_R                                      ~23     ~20, ~22
         26        ASSIGN_OP                                     8          !2, ~23
   81    27        POST_INC                                         ~25     !3
         28        IS_SMALLER_OR_EQUAL                                      !1, ~25
         29      > JMPZ                                                     ~26, ->31
   82    30    > > JMP                                                      ->55
   83    31    >   IS_SMALLER                                               !3, !1
         32      > JMPZ                                                     ~27, ->39
   84    33    >   INIT_FCALL                                               'ord'
         34        FETCH_DIM_R                                      ~28     !0, !3
         35        SEND_VAL                                                 ~28
         36        DO_ICALL                                         $29     
         37        SL                                               ~30     $29, 16
         38        ASSIGN_OP                                     9          !4, ~30
   85    39    >   SR                                               ~33     !4, 12
         40        BW_AND                                           ~34     ~33, 63
         41        FETCH_OBJ_R                                      ~32     'itoa64'
         42        FETCH_DIM_R                                      ~35     ~32, ~34
         43        ASSIGN_OP                                     8          !2, ~35
   86    44        POST_INC                                         ~37     !3
         45        IS_SMALLER_OR_EQUAL                                      !1, ~37
         46      > JMPZ                                                     ~38, ->48
   87    47    > > JMP                                                      ->55
   88    48    >   SR                                               ~40     !4, 18
         49        BW_AND                                           ~41     ~40, 63
         50        FETCH_OBJ_R                                      ~39     'itoa64'
         51        FETCH_DIM_R                                      ~42     ~39, ~41
         52        ASSIGN_OP                                     8          !2, ~42
   89    53        IS_SMALLER                                               !3, !1
         54      > JMPNZ                                                    ~44, ->4
   91    55    > > RETURN                                                   !2
   92    56*     > RETURN                                                   null

End of function encode64

Function gensalt_private:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wpbr3
function name:  gensalt_private
number of ops:  22
compiled vars:  !0 = $input, !1 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   94     0  E >   RECV                                             !0      
   96     1        ASSIGN                                                   !1, '%24P%24'
   97     2        INIT_FCALL                                               'min'
          3        FETCH_OBJ_R                                      ~4      'iteration_count_log2'
   98     4      > JMPZ                                                     <true>, ->7
          5    >   QM_ASSIGN                                        ~5      5
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~5      3
          8    >   ADD                                              ~6      ~4, ~5
          9        SEND_VAL                                                 ~6
         10        SEND_VAL                                                 30
         11        DO_ICALL                                         $7      
   97    12        FETCH_OBJ_R                                      ~3      'itoa64'
   98    13        FETCH_DIM_R                                      ~8      ~3, $7
         14        ASSIGN_OP                                     8          !1, ~8
   99    15        INIT_METHOD_CALL                                         'encode64'
         16        SEND_VAR_EX                                              !0
         17        SEND_VAL_EX                                              6
         18        DO_FCALL                                      0  $10     
         19        ASSIGN_OP                                     8          !1, $10
  101    20      > RETURN                                                   !1
  102    21*     > RETURN                                                   null

End of function gensalt_private

Function crypt_private:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 47) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 48
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 64
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 63, Position 2 = 55
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 84
Branch analysis from position: 84
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
Branch analysis from position: 64
2 jumps found. (Code = 44) Position 1 = 84, Position 2 = 73
Branch analysis from position: 84
Branch analysis from position: 73
Branch analysis from position: 34
Branch analysis from position: 21
Branch analysis from position: 11
filename:       /in/Wpbr3
function name:  crypt_private
number of ops:  97
compiled vars:  !0 = $password, !1 = $setting, !2 = $output, !3 = $id, !4 = $count_log2, !5 = $count, !6 = $salt, !7 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  104     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  106     2        ASSIGN                                                   !2, '%2A0'
  107     3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 2
          7        DO_ICALL                                         $9      
          8        IS_EQUAL                                                 !2, $9
          9      > JMPZ                                                     ~10, ->11
  108    10    >   ASSIGN                                                   !2, '%2A1'
  110    11    >   INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 3
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !3, $12
  112    17        IS_NOT_EQUAL                                     ~14     !3, '%24P%24'
         18      > JMPZ_EX                                          ~14     ~14, ->21
         19    >   IS_NOT_EQUAL                                     ~15     !3, '%24H%24'
         20        BOOL                                             ~14     ~15
         21    > > JMPZ                                                     ~14, ->23
  113    22    > > RETURN                                                   !2
  115    23    >   INIT_FCALL                                               'strpos'
         24        FETCH_OBJ_R                                      ~16     'itoa64'
         25        SEND_VAL                                                 ~16
         26        FETCH_DIM_R                                      ~17     !1, 3
         27        SEND_VAL                                                 ~17
         28        DO_ICALL                                         $18     
         29        ASSIGN                                                   !4, $18
  116    30        IS_SMALLER                                       ~20     !4, 7
         31      > JMPNZ_EX                                         ~20     ~20, ->34
         32    >   IS_SMALLER                                       ~21     30, !4
         33        BOOL                                             ~20     ~21
         34    > > JMPZ                                                     ~20, ->36
  117    35    > > RETURN                                                   !2
  119    36    >   SL                                               ~22     1, !4
         37        ASSIGN                                                   !5, ~22
  121    38        INIT_FCALL                                               'substr'
         39        SEND_VAR                                                 !1
         40        SEND_VAL                                                 4
         41        SEND_VAL                                                 8
         42        DO_ICALL                                         $24     
         43        ASSIGN                                                   !6, $24
  122    44        STRLEN                                           ~26     !6
         45        IS_NOT_EQUAL                                             ~26, 8
         46      > JMPZ                                                     ~27, ->48
  123    47    > > RETURN                                                   !2
  131    48    > > JMPZ                                                     <true>, ->64
  132    49    >   INIT_FCALL                                               'md5'
         50        CONCAT                                           ~28     !6, !0
         51        SEND_VAL                                                 ~28
         52        SEND_VAL                                                 <true>
         53        DO_ICALL                                         $29     
         54        ASSIGN                                                   !7, $29
  134    55    >   INIT_FCALL                                               'md5'
         56        CONCAT                                           ~31     !7, !0
         57        SEND_VAL                                                 ~31
         58        SEND_VAL                                                 <true>
         59        DO_ICALL                                         $32     
         60        ASSIGN                                                   !7, $32
  135    61        PRE_DEC                                          ~34     !5
         62      > JMPNZ                                                    ~34, ->55
         63    > > JMP                                                      ->84
  137    64    >   INIT_FCALL                                               'pack'
         65        SEND_VAL                                                 'H%2A'
         66        INIT_FCALL                                               'md5'
         67        CONCAT                                           ~35     !6, !0
         68        SEND_VAL                                                 ~35
         69        DO_ICALL                                         $36     
         70        SEND_VAR                                                 $36
         71        DO_ICALL                                         $37     
         72        ASSIGN                                                   !7, $37
  139    73    >   INIT_FCALL                                               'pack'
         74        SEND_VAL                                                 'H%2A'
         75        INIT_FCALL                                               'md5'
         76        CONCAT                                           ~39     !7, !0
         77        SEND_VAL                                                 ~39
         78        DO_ICALL                                         $40     
         79        SEND_VAR                                                 $40
         80        DO_ICALL                                         $41     
         81        ASSIGN                                                   !7, $41
  140    82        PRE_DEC                                          ~43     !5
         83      > JMPNZ                                                    ~43, ->73
  143    84    >   INIT_FCALL                                               'substr'
         85        SEND_VAR                                                 !1
         86        SEND_VAL                                                 0
         87        SEND_VAL                                                 12
         88        DO_ICALL                                         $44     
         89        ASSIGN                                                   !2, $44
  144    90        INIT_METHOD_CALL                                         'encode64'
         91        SEND_VAR_EX                                              !7
         92        SEND_VAL_EX                                              16
         93        DO_FCALL                                      0  $46     
         94        ASSIGN_OP                                     8          !2, $46
  146    95      > RETURN                                                   !2
  147    96*     > RETURN                                                   null

End of function crypt_private

Function gensalt_extended:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wpbr3
function name:  gensalt_extended
number of ops:  38
compiled vars:  !0 = $input, !1 = $count_log2, !2 = $count, !3 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  149     0  E >   RECV                                             !0      
  151     1        INIT_FCALL                                               'min'
          2        FETCH_OBJ_R                                      ~4      'iteration_count_log2'
          3        ADD                                              ~5      ~4, 8
          4        SEND_VAL                                                 ~5
          5        SEND_VAL                                                 24
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !1, $6
  154     8        SL                                               ~8      1, !1
          9        SUB                                              ~9      ~8, 1
         10        ASSIGN                                                   !2, ~9
  156    11        ASSIGN                                                   !3, '_'
  157    12        BW_AND                                           ~13     !2, 63
         13        FETCH_OBJ_R                                      ~12     'itoa64'
         14        FETCH_DIM_R                                      ~14     ~12, ~13
         15        ASSIGN_OP                                     8          !3, ~14
  158    16        SR                                               ~17     !2, 6
         17        BW_AND                                           ~18     ~17, 63
         18        FETCH_OBJ_R                                      ~16     'itoa64'
         19        FETCH_DIM_R                                      ~19     ~16, ~18
         20        ASSIGN_OP                                     8          !3, ~19
  159    21        SR                                               ~22     !2, 12
         22        BW_AND                                           ~23     ~22, 63
         23        FETCH_OBJ_R                                      ~21     'itoa64'
         24        FETCH_DIM_R                                      ~24     ~21, ~23
         25        ASSIGN_OP                                     8          !3, ~24
  160    26        SR                                               ~27     !2, 18
         27        BW_AND         

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.24 ms | 1428 KiB | 39 Q