PHP sha1_file Function

What is sha1_file Function?


In PHP this function is used to calculate the sha1 hash of a file, using the US Secure Hash Algorithm.Its another like the md5 Algorithm.



In the above syntax "file" specifies the file to calculate sha1 hash, "raw" specifies the output format by default its hexadecimal, if the value is true then the output will be in binary format.

Example :

$file = "test.txt";
$eg = sha1_file($file);
echo $eg;
Result :


In the above sha1_file function example a text file "test.txt" which has the text "HIOX INDIA" is encrypted in sha1file algorithm.

PHP Topics

Ask Questions

Ask Question