Im trying to implement the Google Safebrowsing update API v4 in PHP. But I can't figure how to correctly decode the rawHashes.
(The rawHashes are 4-bytes-truncated sha256 hashes and then concatenated).
I am trying the native base64_decode of PHP but I can't fully decode the string, and I don't know what the next step is.
According to the API documentation here's how the rawhashes are encoded :
string (bytes format) The hashes, in binary format, concatenated into one long string. Hashes are sorted in lexicographic order. For JSON API users, hashes are base64-encoded. A base64-encoded string.
I an very symply decoding the string like so :
$decoded = base64_decode($rawHashes);
The base64 encoded string look like this :
And the base64 decoded string look like this :
As you can see something is not right and I must miss a step but I can't figure wich one.