This Python script calculates the SHA256 digest of a specified file. It can also compare the calculated digest against a provided SHA256 hash to verify file integrity.
Python 3.x
The script can be used in two modes:
Calculate SHA256 digest of a file:
python script.py [path_to_file]
Calculate and compare SHA256 digest:
python script.py [path_to_file] [SHA256_digest]