Description string sha1 ( string $str [, bool $raw_output = false ] )Calculates the sha1 hash of str using the » US Secure Hash Algorithm 1. Report a bug Parametersstr The input string. raw_output If the optional raw_output is set to TRUE, then the sha1 digest is instead returned in raw binary format with a length of 20, otherwise the returned value is a 40-character hexadecimal number.============== 这个函数的输出本来就是固定长度
<?php
$a = "mmmmmmmmmmmmmmmmmmmmsadfkhafjkadshfsdjfiosadkfnskdljfsiljflksdjfkldsjfiojcn";
echo sha1($a)."<hr>".sha1($a);
?>无论$a是什么字符串,得到的答案都是一样的长度。
string sha1 ( string $str [, bool $raw_output = false ] )Calculates the sha1 hash of str using the » US Secure Hash Algorithm 1.
Report a bug
Parametersstr The input string.
raw_output If the optional raw_output is set to TRUE, then the sha1 digest is instead returned in raw binary format with a length of 20, otherwise the returned value is a 40-character hexadecimal number.==============
这个函数的输出本来就是固定长度