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 = '{"key":"AIzaSyB7tA6WOQ3NAch5ylIi_jy7G1raAUxhtdI","Location":"4359941.5,701046.625", "Timestamp":"1458000000"}'; //$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 scOKV
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
array(3) { ["key"]=> string(39) "AIzaSyB7tA6WOQ3NAch5ylIi_jy7G1raAUxhtdI" ["Location"]=> string(20) "4359941.5,701046.625" ["Timestamp"]=> string(10) "1458000000" } HashLK-94c3cff80926a344726ec08a4f486104ac3e44e163b37b9ca4052076d511e58e HashBD-230b9d7d8c5036d3b79fc0acdc304f131c998865101e9ae6692ec8b52e24bf36 ElMD5:bd670ced10775dbc2d8b83e07d688607