Definition
The sha1_file() function calculates the SHA-1 hash of a file.
Syntax
sha1_file(file, raw)
Parameters
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 |
Example
<?php
$sha1file = sha1_file("sample.txt");
file_put_contents("sha1file.txt",$sha1file);