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

End of function dohash

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

End of function getcharacterkey

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
200.91 ms | 1427 KiB | 24 Q