Base64_encode different between Java and PHP

一曲冷凌霜 提交于 2019-12-02 06:33:02

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!