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":153042,"Telefono":"650849571","RxTlf":"22","Email":"jaime@likeik.com", "RxEmail":"23", "DeliveryId":1222}'; //$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 0NsG6
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
array(6) { ["Tablet"]=> int(153042) ["Telefono"]=> string(9) "650849571" ["RxTlf"]=> string(2) "22" ["Email"]=> string(16) "jaime@likeik.com" ["RxEmail"]=> string(2) "23" ["DeliveryId"]=> int(1222) } HashLK-04eceed1bb5bd82ee1ed6bc4473815a9800cc3a6ce4ef915053ca03a0aaa9184 HashBD-b53b546343e1c3194a803146bdd9b04a2682644f383291fcb1547e8b29eee24f ElMD5:fd012a7bea401f4a926720a4f6f9b737