fileChecksum.php
Table of Contents
Functions
- fileChecksum() : string
- Computes the checksum (hash) of a file's contents.
Functions
fileChecksum()
Computes the checksum (hash) of a file's contents.
fileChecksum(string $file[, string $algorithm = 'sha256' ]) : string
Reads the file through hash_file(), so the whole file does not need to be
loaded into memory. Useful for integrity checks, deduplication, and verifying
extracted archives.
Parameters
- $file : string
-
Path to the file to hash.
- $algorithm : string = 'sha256'
-
A hashing algorithm supported by hash_algos() (default:
'sha256').
Tags
Return values
string —The computed hash, lowercase hexadecimal.