PHP 有 md5()、sha1() ... 等等 function,不过现在建议使用 SHA224 以上(注),在 PHP 要怎么写呢?
MD5 is considered cryptographically broken and is unsuitable for further use.
The SHA1 algorithm might not be secure enough for ongoing use. It is recommended not to use SHA1.
SHA224: SHA224 produces a 224-bit (28-byte) hash value, typically rendered as a hexadecimal number, 56 digits long.
SHA256: SHA256 produces a 256-bit (32-byte) hash value, typically rendered as a hexadecimal number, 64 digits long.
SHA384: SHA384 produces a 384-bit (48-byte) hash value, typically rendered as a hexadecimal number, 96 digits long.
SHA512: SHA512 produces a 512-bit (64-byte) hash value, typically rendered as a hexadecimal number, 128 digits long.
RIPEMD160: RIPEMD160 produces a 160-bit (20-byte) hash value, typically rendered as a hexadecimal number, 40 digits long.
PHP 使用 SHA256、SHA512 等 哈希算法的写法