What is the significance of using sha1_file with the correct file name in PHP?
Using sha1_file with the correct file name in PHP is important because it calculates the SHA-1 hash of a file. This hash value can be used for various purposes such as verifying file integrity, comparing files, or generating unique identifiers. By providing the correct file name to sha1_file, you ensure that the hash value is calculated for the intended file.
$file = 'example.txt';
$hash = sha1_file($file);
echo $hash;