PHP » I/O » sha1_file()

Syntax:
string sha1_file(string filename)
filename
The name of the file.

Returns an sha1 hash for a file.

This function returns an 160-bit sha1 hash of a file and can be used to verify the integrity of a file. If the call fails, FALSE is returned.

Examples

Code:
<?php

print "sha1 hash for log.txt: " . sha1_file("log.txt");

?>
Output:
sha1 hash for log.txt: 56afe6a19be03c97f49fd18e615e0417302e9a1c
Explanation:

An sha1 hash for log.txt is generated and printed.

See Also: