Java SHA256 outputs different hash to PHP SHA256?

后端 未结 3 1664
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-01 13:12

PHP code:

echo hash(\'sha256\', \'jake\');

PHP output:

cdf30c6b345276278bedc7bcedd9d5582f5b8e0c1dd858f46ef4ea231f92731d

Java cod

3条回答
  •  半阙折子戏
    2020-12-01 13:46

    You need to convert the digest to a HEX string before printing it out. Example code can be found here.

提交回复
热议问题