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); $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 floor($hashArray[($i+$j)%32]/1234) . " "; } $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); } if ($key < 0) { return -(2147483648 - ($key & 2147483584)); } else { return ($key & 2147483584); } } echo doHash("ab"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L79Bo
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   73     0  E >   INIT_FCALL                                               'dohash'
          1        SEND_VAL                                                 'ab'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   74     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 = 244
Branch analysis from position: 244
2 jumps found. (Code = 44) Position 1 = 246, Position 2 = 21
Branch analysis from position: 246
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 = 170
Branch analysis from position: 170
2 jumps found. (Code = 44) Position 1 = 172, Position 2 = 145
Branch analysis from position: 172
1 jumps found. (Code = 42) Position 1 = 189
Branch analysis from position: 189
2 jumps found. (Code = 44) Position 1 = 191, Position 2 = 175
Branch analysis from position: 191
2 jumps found. (Code = 44) Position 1 = 246, Position 2 = 21
Branch analysis from position: 246
Branch analysis from position: 21
Branch analysis from position: 175
2 jumps found. (Code = 44) Position 1 = 191, Position 2 = 175
Branch analysis from position: 191
Branch analysis from position: 175
Branch analysis from position: 145
2 jumps found. (Code = 44) Position 1 = 172, Position 2 = 145
Branch analysis from position: 172
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/L79Bo
function name:  doHash
number of ops:  248
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
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        IS_EQUAL                                                 !0, ''
          2      > JMPZ                                                     ~8, ->4
          3    > > RETURN                                                   ''
    5     4    >   ASSIGN                                                   !1, 'abcdefghijklmnopqrstuvwxyz_'
    6     5        ASSIGN                                                   !2, '0123456789ABCDEF'
    7     6        ASSIGN                                                   !3, ''
    8     7        ASSIGN                                                   !4, <array>
    9     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
   10    19    >   ASSIGN                                                   !5, 0
         20      > JMP                                                      ->244
   12    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
   13    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
   17   109        ASSIGN                                                   !6, 0
        110      > JMP                                                      ->141
   18   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
   19   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
   17   140    >   PRE_INC                                                  !6
        141    >   IS_SMALLER                                               !6, 3
        142      > JMPNZ                                                    ~87, ->111
   26   143    >   ASSIGN                                                   !6, 0
        144      > JMP                                                      ->170
   27   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
   28   160        INIT_FCALL                                               'floor'
        161        ADD                                              ~98     !5, !6
        162        MOD                                              ~99     ~98, 32
        163        FETCH_DIM_R                                      ~100    !4, ~99
        164        DIV                                              ~101    ~100, 1234
        165        SEND_VAL                                                 ~101
        166        DO_ICALL                                         $102    
        167        CONCAT                                           ~103    $102, '+'
        168        ECHO                                                     ~103
   26   169        PRE_INC                                                  !6
        170    >   IS_SMALLER                                               !6, 2
        171      > JMPNZ                                                    ~105, ->145
   35   172    >   ASSIGN                                                   !7, 0
   36   173        ASSIGN                                                   !6, 0
        174      > JMP                                                      ->189
   38   175    >   FETCH_DIM_R                                      ~108    !4, !5
        176        INIT_FCALL                                               'pow'
        177        SEND_VAL                                                 2
        178        MUL                                              ~109    !6, 2
        179        MOD                                              ~110    !5, 2
        180        ADD                                              ~111    ~109, ~110
        181        SEND_VAL                                                 ~111
        182        DO_ICALL                                         $112    
        183        BW_AND                                           ~113    $112, ~108
        184        MOD                                              ~114    !5, 2
        185        ADD                                              ~115    !6, ~114
        186        SR                                               ~116    ~113, ~115
        187        ASSIGN_OP                                     1          !7, ~116
   36   188        PRE_INC                                                  !6
        189    >   IS_SMALLER                                               !6, 16
        190      > JMPNZ                                                    ~119, ->175
   43   191    >   ASSIGN_DIM                                               !4, !5
        192        OP_DATA                                                  !7
   44   193        INIT_FCALL                                               'substr'
        194        SEND_VAR                                                 !2
        195        INIT_FCALL                                               'floor'
        196        FETCH_DIM_R                                      ~121    !4, !5
        197        BW_AND                                           ~122    ~121, 65280
        198        SR                                               ~123    ~122, 8
        199        DIV                                              ~124    ~123, 16
        200        SEND_VAL                                                 ~124
        201        DO_ICALL                                         $125    
        202        SEND_VAR                                                 $125
        203        SEND_VAL                                                 1
        204        DO_ICALL                                         $126    
        205        ASSIGN_OP                                     8          !3, $126
   45   206        INIT_FCALL                                               'substr'
        207        SEND_VAR                                                 !2
        208        INIT_FCALL                                               'floor'
        209        FETCH_DIM_R                                      ~128    !4, !5
        210        BW_AND                                           ~129    ~128, 65280
        211        SR                                               ~130    ~129, 8
        212        MOD                                              ~131    ~130, 16
        213        SEND_VAL                                                 ~131
        214        DO_ICALL                                         $132    
        215        SEND_VAR                                                 $132
        216        SEND_VAL                                                 1
        217        DO_ICALL                                         $133    
        218        ASSIGN_OP                                     8          !3, $133
   46   219        INIT_FCALL                                               'substr'
        220        SEND_VAR                                                 !2
        221        INIT_FCALL                                               'floor'
        222        FETCH_DIM_R                                      ~135    !4, !5
        223        BW_AND                                           ~136    ~135, 255
        224        DIV                                              ~137    ~136, 16
        225        SEND_VAL                                                 ~137
        226        DO_ICALL                                         $138    
        227        SEND_VAR                                                 $138
        228        SEND_VAL                                                 1
        229        DO_ICALL                                         $139    
        230        ASSIGN_OP                                     8          !3, $139
   47   231        INIT_FCALL                                               'substr'
        232        SEND_VAR                                                 !2
        233        INIT_FCALL                                               'floor'
        234        FETCH_DIM_R                                      ~141    !4, !5
        235        BW_AND                                           ~142    ~141, 255
        236        MOD                                              ~143    ~142, 16
        237        SEND_VAL                                                 ~143
        238        DO_ICALL                                         $144    
        239        SEND_VAR                                                 $144
        240        SEND_VAL                                                 1
        241        DO_ICALL                                         $145    
        242        ASSIGN_OP                                     8          !3, $145
   10   243        PRE_INC                                                  !5
        244    >   IS_SMALLER                                               !5, 32
        245      > JMPNZ                                                    ~148, ->21
   49   246    > > RETURN                                                   !3
   50   247*     > 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/L79Bo
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
-------------------------------------------------------------------------------------
   52     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   54     2        ASSIGN                                                   !2, 'abcdefghijklmnopqrstuvwxyz_'
   55     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
   56    11        ASSIGN                                                   !4, 0
         12      > JMP                                                      ->33
   58    13    >   SL                                               ~12     !3, 1
         14        ASSIGN                                                   !3, ~12
   59    15        ASSIGN_OP                                     5          !3, 2147483648
   60    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
   61    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
   56    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
   64    39    >   IS_SMALLER                                               !3, 0
         40      > JMPZ                                                     ~30, ->46
   65    41    >   BW_AND                                           ~31     !3, 2147483584
         42        SUB                                              ~32     2147483648, ~31
         43        MUL                                              ~33     ~32, -1
         44      > RETURN                                                   ~33
         45*       JMP                                                      ->48
   67    46    >   BW_AND                                           ~34     !3, 2147483584
         47      > RETURN                                                   ~34
   70    48*     > RETURN                                                   null

End of function getcharacterkey

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.41 ms | 1427 KiB | 24 Q