Base64_encode different between Java and PHP

前端 未结 1 1068
挽巷
挽巷 2021-01-23 16:04

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         


        
相关标签:
1条回答
  • 2021-01-23 16:16

    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.

    0 讨论(0)
提交回复
热议问题