3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 = '{"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;
based on kYnZ4
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0alpha1
array(5) { ["Cuestionario"]=> string(2) "15" ["Rx"]=> string(1) "4" ["Agregacion"]=> string(1) "U" ["Periodo"]=> string(1) "T" ["Nulls"]=> string(2) "No" } HashLK-2dfc4f21341f6a59ae18702e374f5addafb96bc89b976eb6176ee62d9b07bee5 HashBD-75c7f61828ba3bf1b8e20ba4826c5e286f77f7d8e62f613a42620f03c4cd7a16 ElMD5:2731491369e457a3889ba8001ac03565