def _hash_of_file(path, algorithm):
 with open(path, 'rb') as archive:
  hash = hashlib.new(algorithm)
  for chunk in read_chunks(archive):
   hash.update(chunk)
 return hash.hexdigest()

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