PHP sha1_file() Function

The sha1_file() function calculates the SHA-1 hash of a file.The sha1_file() function uses the US Secure Hash Algorithm 1.

string sha1_file ( string $filename [, bool $raw_output = FALSE ] )

Calculates the sha1 hash of the file specified by filename using the ยป US Secure Hash Algorithm 1, and returns that hash. The hash is a 40-character hexadecimal number.

Example -

ParameterDescription
filenameThe filename of the file to hash.
raw_outputWhen TRUE, returns the digest in raw binary format with a length of 20.

Return Values

Returns a string on success, FALSE otherwise.