def _hash_of_file(path, algorithm):
with open(path, '<STR_LIT:rb>') as archive:<EOL><INDENT>hash = hashlib.new(algorithm)<EOL>for chunk in read_chunks(archive):<EOL><INDENT>hash.update(chunk)<EOL><DEDENT><DEDENT>return hash.hexdigest()<EOL>
Return the hash digest of a file.