3v4l.org

run code in 300+ PHP versions simultaneously
<?php $HashPrivado = 'ec7363b7c7ff3ab851335f801568dec5115f09705a45f7d849928e906e0964b0'; $HashPBD = '746e085ea210dd7c14f3cad3f6113767aa58439bebee6459989141c0f0474bff'; $BodyCupon = array( "Tipo" => "code128", "Codigo" => "1234567", "Tam" => 300, "Color" => "black", "ColorB" => "white", "AltoB"=> 50, "AnchoB"=> 2 ); //Preparo la llamada //$Parametros = json_encode($BodyCupon); $Parametros = '{"Empresa":1014,"Cuestionario":"15","Rx":"4","Agregacion":"U", "Periodo":"T", "Nulls":"No"}'; //$Parametros = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; var_dump(json_decode($Parametros, TRUE)); //Usando el hash privado, firmamos el contenido a transmitir (los parĂ¡metros) $ElHash = hash_hmac('sha256', $Parametros, $HashPrivado); $ElHashBD = hash_hmac('sha256', $Parametros, $HashPBD); echo 'HashLK-'.$ElHash.PHP_EOL; echo 'HashBD-'.$ElHashBD.PHP_EOL; $HashMD5 = hash('md5', $Parametros, FALSE); echo 'ElMD5:'.$HashMD5;
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.5 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
array(6) { ["Empresa"]=> int(1014) ["Cuestionario"]=> string(2) "15" ["Rx"]=> string(1) "4" ["Agregacion"]=> string(1) "U" ["Periodo"]=> string(1) "T" ["Nulls"]=> string(2) "No" } HashLK-34b4117ed34674a53eb59d3888443260be67b0e14a1e36e383f76ea3aee3211b HashBD-aceb9412af07791c266469e43dc9665f71f7a4c0c5eec8e6531c1fde3e823fcc ElMD5:48c413e961c224cde703516baacbed89
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 array(6) { ["Empresa"]=> int(1014) ["Cuestionario"]=> string(2) "15" ["Rx"]=> string(1) "4" ["Agregacion"]=> string(1) "U" ["Periodo"]=> string(1) "T" ["Nulls"]=> string(2) "No" } HashLK-34b4117ed34674a53eb59d3888443260be67b0e14a1e36e383f76ea3aee3211b HashBD-aceb9412af07791c266469e43dc9665f71f7a4c0c5eec8e6531c1fde3e823fcc ElMD5:48c413e961c224cde703516baacbed89

preferences:
155.24 ms | 402 KiB | 172 Q