Help Home (www.Bkjia.com) tutorial starting with PHP5.1.2, PHP adds a new hash engine that provides up to 35 different hash algorithms, including the MD5 algorithm, SHA1 algorithm.
Let's actually test the effect (PHP5):
The following is the referenced content: $string = ' password '; echo MD5 ($string);//the original MD5 function Echo ' '; echo Hash (' MD5 ', $string);//new hash function, first parameter specifies the algorithm name ?> |
Running the above code, you will find two of the same values as "d41d8cd98f00b204e9800998ecf8427e". This hash function can be seen to be compatible with the MD5 algorithm. You can replace the above code in the two "MD5" replaced by "SHA1", run again, you can test the effect of the SHA1 algorithm.
http://www.bkjia.com/PHPjc/364356.html www.bkjia.com true http://www.bkjia.com/PHPjc/364356.html techarticle Fire Net (liehuo.net) tutorial starting with PHP5.1.2, PHP adds a new hash engine that provides up to 35 different hash algorithms, including the MD5 algorithm, SHA1 algorithm. Let's do the following ...