Skip to end of metadata
Go to start of metadata

If you want to make a simple logic to get hash value for file, hash_file() gives you a straightforward solution.Example using hash_file()

/* Create a file to calculate hash of */
file_put_contents('example.txt', 'The quick brown fox jumped over the lazy dog.');

echo hash_file('md5', 'example.txt');

The below is the output for above