Here is my problem :
I have a JAVA function to generate an encrypted string. I have to do the same thing in PHP.
My Java function :
String genera
The answer is in the documentation for the PHP function hash_hmac.
When set to TRUE, outputs raw binary data. FALSE outputs lowercase hexits.
Pass "true" as the final argument. Hashes are binary. When turning them into strings, they are often encoded in hexadecimal. But in this case you are going to base-64 encode it, so you want the raw binary form.