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('R3loadN3tcompanyIda36a75830-be27-e111-a4dc-0050568b2fc3', 'UTF-8'); // Generate raw/byte hash. $hash = hash('sha256', $secret, TRUE); // Get the base64 value. $signature = base64_encode($hash); print 'Signature: ' . $signature;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aYBQh
function name:  (null)
number of ops:  18
compiled vars:  !0 = $secret, !1 = $hash, !2 = $signature
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'mb_convert_encoding'
          1        SEND_VAL                                                 'R3loadN3tcompanyIda36a75830-be27-e111-a4dc-0050568b2fc3'
          2        SEND_VAL                                                 'UTF-8'
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
   14     5        INIT_FCALL                                               'hash'
          6        SEND_VAL                                                 'sha256'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !1, $5
   16    11        INIT_FCALL                                               'base64_encode'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $7      
         14        ASSIGN                                                   !2, $7
   18    15        CONCAT                                           ~9      'Signature%3A+', !2
         16        ECHO                                                     ~9
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.11 ms | 1394 KiB | 19 Q