为什么无论字符串有多少,为什么加密出来的东西都是一样长的??

解决方案 »

  1.   

    我用的sha1加密方式:
    <?php
    $a = "mmmmmmmmmmmmmmmmmmmmsadfkhafjkadshfsdjfiosadkfnskdljfsiljflksdjfkldsjfiojcn";
    echo sha1($a)."<hr>".sha1($a);
    ?>无论$a是什么字符串,得到的答案都是一样的长度。
      

  2.   

    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.==============
    这个函数的输出本来就是固定长度