what is the syntax of the SHA1_FILE() function in php?
sha1_file(file,raw)
Parameter | Description |
---|---|
file | Required. The file to be calculated |
raw | Optional. A boolean value that specifies hex or binary output format:TRUE – Raw 20 character binary formatFALSE – Default. 40 character hex number |
examples of the SHA1_FILE() function
Example 1. In this example, we calculate the SHA-1 hash of the text file “test.txt”.
<?php
$filename = "test.txt";
$sha1file = sha1_file($filename);
echo $sha1file;
?>