Section 13.15. File Checksums


13.15. File Checksums

PHP's sha1_file( ) function creates a checksum hash value using the SHA1 algorithm. To use it, pass the filename and capture the return value, like this:

     $sha1 = sha1_file($filename); 

For MD5 hashing, you can use the function md5_file( ). It works in exactly the same way as sha1_file( ), except that it returns the MD5 hash as opposed to the SHA1 hash.



PHP in a Nutshell
Ubuntu Unleashed
ISBN: 596100671
EAN: 2147483647
Year: 2003
Pages: 249

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net