3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * var hash = System.Security.Cryptography.SHA256.Create(); * hash.ComputeHash(System.Text.Encoding.Unicode.GetBytes(secretKey + guid)); * aCookie.Values[""signatur""] = Convert.ToBase64String(hash.Hash); */ // Make sure we have the same encoding on both strings. $guid = mb_convert_encoding('36a75830-be27-e111-a4dc-0050568b2fc3', 'UTF-8'); $secret = mb_convert_encoding('R3loadN3tcompanyIda', 'UTF-8'); // Generate raw/byte hash. $hash = hash('sha256', $secret . $guid, TRUE); // Get the base64 value. $signature = base64_encode($hash); print $signature;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ao7BH
function name:  (null)
number of ops:  23
compiled vars:  !0 = $guid, !1 = $secret, !2 = $hash, !3 = $signature
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'mb_convert_encoding'
          1        SEND_VAL                                                 '36a75830-be27-e111-a4dc-0050568b2fc3'
          2        SEND_VAL                                                 'UTF-8'
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !0, $4
   11     5        INIT_FCALL                                               'mb_convert_encoding'
          6        SEND_VAL                                                 'R3loadN3tcompanyIda'
          7        SEND_VAL                                                 'UTF-8'
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !1, $6
   14    10        INIT_FCALL                                               'hash'
         11        SEND_VAL                                                 'sha256'
         12        CONCAT                                           ~8      !1, !0
         13        SEND_VAL                                                 ~8
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !2, $9
   16    17        INIT_FCALL                                               'base64_encode'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $11     
         20        ASSIGN                                                   !3, $11
   18    21        ECHO                                                     !3
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.87 ms | 1386 KiB | 19 Q