Answer the question
In order to leave comments, you need to log in
How to remove HMAC-Sha1 signature from JSON data?
Good afternoon. I am creating a signature for the merchant and there was such a problem.
It is necessary to remove the HMAC-Sha1 signature from the transmitted JSON data (byte array) and then transfer that signature back to the byte array.
The question is how to translate json data into an array of bytes? And do I need to translate something at all, maybe I misunderstood?
$data = array(
"test" => 123,
"test2" => 123
);
$key = "123123123";
$hash = hash_hmac("sha1", $data, $key, $raw_output=TRUE);
Answer the question
In order to leave comments, you need to log in
Read the documentation.
It is possible that in general it is necessary to do through pack ().
UPD: Generate json data and then remove the signature from this line.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question