3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $HashPrivado = 'ec7363b7c7ff3ab851335f801568dec5115f09705a45f7d849928e906e0964b0'; $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":153023,"Telefono":"691666156","RxTlf":"7","Email":"jaguilera@likeik.com", "RxEmail":"6", "DeliveryId":812762}'; //$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); echo $ElHash;
based on qXk9E
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
array(6) { ["Tablet"]=> int(153023) ["Telefono"]=> string(9) "691666156" ["RxTlf"]=> string(1) "7" ["Email"]=> string(20) "jaguilera@likeik.com" ["RxEmail"]=> string(1) "6" ["DeliveryId"]=> int(812762) } 7d4b4cd78cb228e1be95ed94b29b0343c139cf53180db4ce3bdde01358b836dd