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 = '{"Tablet":151103,"Telefono":"650849571","RxTlf":"7","Email":"jaime@likeik.com", "RxEmail":"6", "DeliveryId":1954227}'; //$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 RITnA
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
array(6) { ["Tablet"]=> int(151103) ["Telefono"]=> string(9) "650849571" ["RxTlf"]=> string(1) "7" ["Email"]=> string(16) "jaime@likeik.com" ["RxEmail"]=> string(1) "6" ["DeliveryId"]=> int(1954227) } HashLK-90ca336c8f252bf0dc5751800561436750deccba7d0352309f3fd12ce843b16b HashBD-306c42a22d4cb9f00e2fac92f31e98ba6b43707df2fb403d27771d28edc54849 ElMD5:84b23522742c1298d89d20bf7f3a4760