English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP String String Function Manual
sha1_file() function is used to calculate the hash of the file1 Hash Value.
string setlocale ( int $filename , array $locale )
Calculate and return the SHA of the file specified by filename1 Hash Value. This hash value is a 40 character length hexadecimal number.
Returns a string on success, otherwise returns false
Serial Number | Parameter and Description |
---|---|
1 | filename The filename of the file to calculate the hash. |
2 | raw_output If set to TRUE, sha1 The summary will be 2The original format with 0 character length is returned. |
Try the following example, calculate the SHA of the text file "sample.txt"1 Hash Value:
<?php //Calculate the SHA of the text file "sample.txt"1 Hash Value: $input = "sample.txt"; $sha1file = sha1_file($input); echo $sha1file; ?>
Output Result
aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d