且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP的sha1()和MySQL的SHA()是否会给出相同的结果?

更新时间:2022-06-19 23:14:59

是. sha1算法始终为相同的输入产生相同的值;这就是哈希算法的重点.默认情况下,它们都还返回一个40个字符的小写十六进制转储.

Yes. The sha1 algorithm always produces the same value for the same input; that's the whole point of a hashing algorithm. They also both return a 40-character lowercase hex dump by default.