<?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":"zzz38.908133,-77.047119", "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;
- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.13
- array(3) {
["key"]=>
string(39) "AIzaSyB7tA6WOQ3NAch5ylIi_jy7G1raAUxhtdI"
["Location"]=>
string(23) "zzz38.908133,-77.047119"
["Timestamp"]=>
string(10) "1458000000"
}
HashLK-4f791ecb51697e7a38558996416663aa2a6cfad8612fc49a215b7df7da32ebf6
HashBD-c33a535ddf968cfcdef016c47d365872631eea85f07a4d3e65a270fb21e6cc83
ElMD5:3ed28c0e4a0b7a689601102beb0fda4c
preferences:
80.38 ms | 412 KiB | 6 Q