3v4l.org

run code in 300+ PHP versions simultaneously
<?php function doHash($string) { if ($string == "") return ""; $passwordChars = "abcdefghijklmnopqrstuvwxyz_"; $hashChars = "0123456789ABCDEF"; $hashedString = ""; $hashArray = Array(32); for($i=0; $i<32; $i++) { $hashArray[$i]=GetCharacterKey($string, $i); } for ($i=0; $i<32; $i++) { if (strpos($passwordChars, substr($string, $i%strlen($string), 1)) == -1) $string= substr($string, 0, $i%strlen($string)) . "_" . substr($string, ($i%strlen($string))+1, (strlen($string)-($i%strlen($string)))-1); echo $hashArray[$i] . " "; $hashArray[$i] += (floor(strpos($passwordChars, substr($string, $i%strlen($string), 1))/9)*16 + floor(strpos($passwordChars, substr($string, $i%strlen($string), 1))%9/3)*4 + floor(strpos($passwordChars, substr($string, $i%strlen($string), 1))%3)); echo $hashArray[$i] . " "; break; for ($j=0; $j<3; $j++) if (($hashArray[$i]&(48>>($j*2))) == (32>>($j*2)) && (GetCharacterKey($string, $i)&(1<<$j))==(1<<$j)) $hashArray[i]=($hashArray[$i]&(255-(48>>($j*2)))) + (48>>($j*2)); for ($j=0; $j<2; $j++) $hashArray[$i] += floor($hashArray[($i+$j)%32]/1234)*pow(4,$j+3); $doubleByteHashNumber = 0; for ($j=0; $j<16; $j++) $doubleByteHashNumber += (($hashArray[$i]&pow(2,($j*2)+($i%2)))>>($j+($i%2))); $hashArray[$i] = $doubleByteHashNumber; $hashedString .= substr($hashChars, floor((($hashArray[$i]&65280)>>8)/16), 1); $hashedString .= substr($hashChars, floor((($hashArray[$i]&65280)>>8)%16), 1); $hashedString .= substr($hashChars, floor(($hashArray[$i]&255)/16), 1); $hashedString .= substr($hashChars, floor(($hashArray[$i]&255)%16), 1); } return $hashedString; } function GetCharacterKey($string, $character) { $passwordChars = "abcdefghijklmnopqrstuvwxyz_"; $key = strpos($passwordChars, $string[$character%strlen($string)]); echo $key; for($i=0; $i<10+strlen($string)+($character*3); $i++) { $key = ($key<<1); $key %= 2147483648; $key += strpos($passwordChars, $string[$i%strlen($string)]); $key = floor(sin($key)*1000000); } if ($key < 0) { echo -(2147483648 - ($key & 2147483584)); return -(2147483648 - ($key & 2147483584)); } else { echo "1: " .($key & 2147483584); return ($key & 2147483584); } } GetCharacterKey("b",0); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ckto8
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E >   INIT_FCALL                                               'getcharacterkey'
          1        SEND_VAL                                                 'b'
          2        SEND_VAL                                                 0
          3        DO_FCALL                                      0          
   59     4      > RETURN                                                   1

Function dohash:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 10
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 242
Branch analysis from position: 242
2 jumps found. (Code = 44) Position 1 = 244, Position 2 = 21
Branch analysis from position: 244
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 57
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 244
Branch analysis from position: 244
Branch analysis from position: 57
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 10
Branch analysis from position: 19
Branch analysis from position: 10
filename:       /in/ckto8
function name:  doHash
number of ops:  246
compiled vars:  !0 = $string, !1 = $passwordChars, !2 = $hashChars, !3 = $hashedString, !4 = $hashArray, !5 = $i, !6 = $j, !7 = $doubleByteHashNumber
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        IS_EQUAL                                                 !0, ''
          2      > JMPZ                                                     ~8, ->4
          3    > > RETURN                                                   ''
    6     4    >   ASSIGN                                                   !1, 'abcdefghijklmnopqrstuvwxyz_'
    7     5        ASSIGN                                                   !2, '0123456789ABCDEF'
    8     6        ASSIGN                                                   !3, ''
    9     7        ASSIGN                                                   !4, <array>
   10     8        ASSIGN                                                   !5, 0
          9      > JMP                                                      ->17
   11    10    >   INIT_FCALL_BY_NAME                                       'GetCharacterKey'
         11        SEND_VAR_EX                                              !0
         12        SEND_VAR_EX                                              !5
         13        DO_FCALL                                      0  $15     
         14        ASSIGN_DIM                                               !4, !5
         15        OP_DATA                                                  $15
   10    16        PRE_INC                                                  !5
         17    >   IS_SMALLER                                               !5, 32
         18      > JMPNZ                                                    ~17, ->10
   13    19    >   ASSIGN                                                   !5, 0
         20      > JMP                                                      ->242
   15    21    >   INIT_FCALL                                               'strpos'
         22        SEND_VAR                                                 !1
         23        INIT_FCALL                                               'substr'
         24        SEND_VAR                                                 !0
         25        STRLEN                                           ~19     !0
         26        MOD                                              ~20     !5, ~19
         27        SEND_VAL                                                 ~20
         28        SEND_VAL                                                 1
         29        DO_ICALL                                         $21     
         30        SEND_VAR                                                 $21
         31        DO_ICALL                                         $22     
         32        IS_EQUAL                                                 $22, -1
         33      > JMPZ                                                     ~23, ->57
         34    >   INIT_FCALL                                               'substr'
         35        SEND_VAR                                                 !0
         36        SEND_VAL                                                 0
         37        STRLEN                                           ~24     !0
         38        MOD                                              ~25     !5, ~24
         39        SEND_VAL                                                 ~25
         40        DO_ICALL                                         $26     
         41        CONCAT                                           ~27     $26, '_'
         42        INIT_FCALL                                               'substr'
         43        SEND_VAR                                                 !0
         44        STRLEN                                           ~28     !0
         45        MOD                                              ~29     !5, ~28
         46        ADD                                              ~30     ~29, 1
         47        SEND_VAL                                                 ~30
         48        STRLEN                                           ~31     !0
         49        STRLEN                                           ~32     !0
         50        MOD                                              ~33     !5, ~32
         51        SUB                                              ~34     ~31, ~33
         52        SUB                                              ~35     ~34, 1
         53        SEND_VAL                                                 ~35
         54        DO_ICALL                                         $36     
         55        CONCAT                                           ~37     ~27, $36
         56        ASSIGN                                                   !0, ~37
   17    57    >   FETCH_DIM_R                                      ~39     !4, !5
         58        CONCAT                                           ~40     ~39, '+'
         59        ECHO                                                     ~40
   18    60        INIT_FCALL                                               'floor'
         61        INIT_FCALL                                               'strpos'
         62        SEND_VAR                                                 !1
         63        INIT_FCALL                                               'substr'
         64        SEND_VAR                                                 !0
         65        STRLEN                                           ~42     !0
         66        MOD                                              ~43     !5, ~42
         67        SEND_VAL                                                 ~43
         68        SEND_VAL                                                 1
         69        DO_ICALL                                         $44     
         70        SEND_VAR                                                 $44
         71        DO_ICALL                                         $45     
         72        DIV                                              ~46     $45, 9
         73        SEND_VAL                                                 ~46
         74        DO_ICALL                                         $47     
         75        MUL                                              ~48     $47, 16
         76        INIT_FCALL                                               'floor'
         77        INIT_FCALL                                               'strpos'
         78        SEND_VAR                                                 !1
         79        INIT_FCALL                                               'substr'
         80        SEND_VAR                                                 !0
         81        STRLEN                                           ~49     !0
         82        MOD                                              ~50     !5, ~49
         83        SEND_VAL                                                 ~50
         84        SEND_VAL                                                 1
         85        DO_ICALL                                         $51     
         86        SEND_VAR                                                 $51
         87        DO_ICALL                                         $52     
         88        MOD                                              ~53     $52, 9
         89        DIV                                              ~54     ~53, 3
         90        SEND_VAL                                                 ~54
         91        DO_ICALL                                         $55     
         92        MUL                                              ~56     $55, 4
         93        ADD                                              ~57     ~48, ~56
         94        INIT_FCALL                                               'floor'
         95        INIT_FCALL                                               'strpos'
         96        SEND_VAR                                                 !1
         97        INIT_FCALL                                               'substr'
         98        SEND_VAR                                                 !0
         99        STRLEN                                           ~58     !0
        100        MOD                                              ~59     !5, ~58
        101        SEND_VAL                                                 ~59
        102        SEND_VAL                                                 1
        103        DO_ICALL                                         $60     
        104        SEND_VAR                                                 $60
        105        DO_ICALL                                         $61     
        106        MOD                                              ~62     $61, 3
        107        SEND_VAL                                                 ~62
        108        DO_ICALL                                         $63     
        109        ADD                                              ~64     ~57, $63
        110        ASSIGN_DIM_OP                +=               1          !4, !5
        111        OP_DATA                                                  ~64
   20   112        FETCH_DIM_R                                      ~65     !4, !5
        113        CONCAT                                           ~66     ~65, '+'
        114        ECHO                                                     ~66
   21   115      > JMP                                                      ->244
   22   116*       ASSIGN                                                   !6, 0
        117*       JMP                                                      ->148
        118*       FETCH_DIM_R                                      ~68     !4, !5
        119*       MUL                                              ~69     !6, 2
        120*       SR                                               ~70     48, ~69
        121*       BW_AND                                           ~71     ~68, ~70
        122*       MUL                                              ~72     !6, 2
        123*       SR                                               ~73     32, ~72
        124*       IS_EQUAL                                         ~74     ~71, ~73
        125*       JMPZ_EX                                          ~74     ~74, ->135
        126*       INIT_FCALL_BY_NAME                                       'GetCharacterKey'
        127*       SEND_VAR_EX                                              !0
        128*       SEND_VAR_EX                                              !5
        129*       DO_FCALL                                      0  $75     
        130*       SL                                               ~76     1, !6
        131*       BW_AND                                           ~77     $75, ~76
        132*       SL                                               ~78     1, !6
        133*       IS_EQUAL                                         ~79     ~77, ~78
        134*       BOOL                                             ~74     ~79
        135*       JMPZ                                                     ~74, ->147
        136*       FETCH_CONSTANT                                   ~80     'i'
        137*       FETCH_DIM_R                                      ~82     !4, !5
        138*       MUL                                              ~83     !6, 2
        139*       SR                                               ~84     48, ~83
        140*       SUB                                              ~85     255, ~84
        141*       BW_AND                                           ~86     ~82, ~85
        142*       MUL                                              ~87     !6, 2
        143*       SR                                               ~88     48, ~87
        144*       ADD                                              ~89     ~86, ~88
        145*       ASSIGN_DIM                                               !4, ~80
        146*       OP_DATA                                                  ~89
        147*       PRE_INC                                                  !6
        148*       IS_SMALLER                                               !6, 3
        149*       JMPNZ                                                    ~91, ->118
   23   150*       ASSIGN                                                   !6, 0
        151*       JMP                                                      ->168
        152*       INIT_FCALL                                               'floor'
        153*       ADD                                              ~94     !5, !6
        154*       MOD                                              ~95     ~94, 32
        155*       FETCH_DIM_R                                      ~96     !4, ~95
        156*       DIV                                              ~97     ~96, 1234
        157*       SEND_VAL                                                 ~97
        158*       DO_ICALL                                         $98     
        159*       INIT_FCALL                                               'pow'
        160*       SEND_VAL                                                 4
        161*       ADD                                              ~99     !6, 3
        162*       SEND_VAL                                                 ~99
        163*       DO_ICALL                                         $100    
        164*       MUL                                              ~101    $98, $100
        165*       ASSIGN_DIM_OP                +=               1          !4, !5
        166*       OP_DATA                                                  ~101
        167*       PRE_INC                                                  !6
        168*       IS_SMALLER                                               !6, 2
        169*       JMPNZ                                                    ~103, ->152
   24   170*       ASSIGN                                                   !7, 0
   25   171*       ASSIGN                                                   !6, 0
        172*       JMP                                                      ->187
        173*       FETCH_DIM_R                                      ~106    !4, !5
        174*       INIT_FCALL                                               'pow'
        175*       SEND_VAL                                                 2
        176*       MUL                                              ~107    !6, 2
        177*       MOD                                              ~108    !5, 2
        178*       ADD                                              ~109    ~107, ~108
        179*       SEND_VAL                                                 ~109
        180*       DO_ICALL                                         $110    
        181*       BW_AND                                           ~111    $110, ~106
        182*       MOD                                              ~112    !5, 2
        183*       ADD                                              ~113    !6, ~112
        184*       SR                                               ~114    ~111, ~113
        185*       ASSIGN_OP                                     1          !7, ~114
        186*       PRE_INC                                                  !6
        187*       IS_SMALLER                                               !6, 16
        188*       JMPNZ                                                    ~117, ->173
   26   189*       ASSIGN_DIM                                               !4, !5
        190*       OP_DATA                                                  !7
   27   191*       INIT_FCALL                                               'substr'
        192*       SEND_VAR                                                 !2
        193*       INIT_FCALL                                               'floor'
        194*       FETCH_DIM_R                                      ~119    !4, !5
        195*       BW_AND                                           ~120    ~119, 65280
        196*       SR                                               ~121    ~120, 8
        197*       DIV                                              ~122    ~121, 16
        198*       SEND_VAL                                                 ~122
        199*       DO_ICALL                                         $123    
        200*       SEND_VAR                                                 $123
        201*       SEND_VAL                                                 1
        202*       DO_ICALL                                         $124    
        203*       ASSIGN_OP                                     8          !3, $124
   28   204*       INIT_FCALL                                               'substr'
        205*       SEND_VAR                                                 !2
        206*       INIT_FCALL                                               'floor'
        207*       FETCH_DIM_R                                      ~126    !4, !5
        208*       BW_AND                                           ~127    ~126, 65280
        209*       SR                                               ~128    ~127, 8
        210*       MOD                                              ~129    ~128, 16
        211*       SEND_VAL                                                 ~129
        212*       DO_ICALL                                         $130    
        213*       SEND_VAR                                                 $130
        214*       SEND_VAL                                                 1
        215*       DO_ICALL                                         $131    
        216*       ASSIGN_OP                                     8          !3, $131
   29   217*       INIT_FCALL                                               'substr'
        218*       SEND_VAR                                                 !2
        219*       INIT_FCALL                                               'floor'
        220*       FETCH_DIM_R                                      ~133    !4, !5
        221*       BW_AND                                           ~134    ~133, 255
        222*       DIV                                              ~135    ~134, 16
        223*       SEND_VAL                                                 ~135
        224*       DO_ICALL                                         $136    
        225*       SEND_VAR                                                 $136
        226*       SEND_VAL                                                 1
        227*       DO_ICALL                                         $137    
        228*       ASSIGN_OP                                     8          !3, $137
   30   229*       INIT_FCALL                                               'substr'
        230*       SEND_VAR                                                 !2
        231*       INIT_FCALL                                               'floor'
        232*       FETCH_DIM_R                                      ~139    !4, !5
        233*       BW_AND                                           ~140    ~139, 255
        234*       MOD                                              ~141    ~140, 16
        235*       SEND_VAL                                                 ~141
        236*       DO_ICALL                                         $142    
        237*       SEND_VAR                                                 $142
        238*       SEND_VAL                                                 1
        239*       DO_ICALL                                         $143    
        240*       ASSIGN_OP                                     8          !3, $143
   13   241*       PRE_INC                                                  !5
        242    >   IS_SMALLER                                               !5, 32
        243      > JMPNZ                                                    ~146, ->21
   32   244    > > RETURN                                                   !3
   33   245*     > RETURN                                                   null

End of function dohash

Function getcharacterkey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 14
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 51
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 14
Branch analysis from position: 40
Branch analysis from position: 14
filename:       /in/ckto8
function name:  GetCharacterKey
number of ops:  57
compiled vars:  !0 = $string, !1 = $character, !2 = $passwordChars, !3 = $key, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   37     2        ASSIGN                                                   !2, 'abcdefghijklmnopqrstuvwxyz_'
   38     3        INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !2
          5        STRLEN                                           ~6      !0
          6        MOD                                              ~7      !1, ~6
          7        FETCH_DIM_R                                      ~8      !0, ~7
          8        SEND_VAL                                                 ~8
          9        DO_ICALL                                         $9      
         10        ASSIGN                                                   !3, $9
   39    11        ECHO                                                     !3
   40    12        ASSIGN                                                   !4, 0
         13      > JMP                                                      ->34
   42    14    >   SL                                               ~12     !3, 1
         15        ASSIGN                                                   !3, ~12
   43    16        ASSIGN_OP                                     5          !3, 2147483648
   44    17        INIT_FCALL                                               'strpos'
         18        SEND_VAR                                                 !2
         19        STRLEN                                           ~15     !0
         20        MOD                                              ~16     !4, ~15
         21        FETCH_DIM_R                                      ~17     !0, ~16
         22        SEND_VAL                                                 ~17
         23        DO_ICALL                                         $18     
         24        ASSIGN_OP                                     1          !3, $18
   45    25        INIT_FCALL                                               'floor'
         26        INIT_FCALL                                               'sin'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                         $20     
         29        MUL                                              ~21     $20, 1000000
         30        SEND_VAL                                                 ~21
         31        DO_ICALL                                         $22     
         32        ASSIGN                                                   !3, $22
   40    33        PRE_INC                                                  !4
         34    >   STRLEN                                           ~25     !0
         35        ADD                                              ~26     10, ~25
         36        MUL                                              ~27     !1, 3
         37        ADD                                              ~28     ~26, ~27
         38        IS_SMALLER                                               !4, ~28
         39      > JMPNZ                                                    ~29, ->14
   48    40    >   IS_SMALLER                                               !3, 0
         41      > JMPZ                                                     ~30, ->51
   49    42    >   BW_AND                                           ~31     !3, 2147483584
         43        SUB                                              ~32     2147483648, ~31
         44        MUL                                              ~33     ~32, -1
         45        ECHO                                                     ~33
   50    46        BW_AND                                           ~34     !3, 2147483584
         47        SUB                                              ~35     2147483648, ~34
         48        MUL                                              ~36     ~35, -1
         49      > RETURN                                                   ~36
         50*       JMP                                                      ->56
   52    51    >   BW_AND                                           ~37     !3, 2147483584
         52        CONCAT                                           ~38     '1%3A+', ~37
         53        ECHO                                                     ~38
   53    54        BW_AND                                           ~39     !3, 2147483584
         55      > RETURN                                                   ~39
   56    56*     > RETURN                                                   null

End of function getcharacterkey

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
281.5 ms | 1423 KiB | 25 Q