def md5_hash_file(path):
 hasher = hashlib.md5()
 with open(path, 'rb') as afile:
  buf = afile.read()
  hasher.update(buf)
  return hasher.hexdigest()

def md5_hash_file ( path ) : hasher = hashlib . md5 ( ) with open ( path , 'rb' ) as afile : buf = afile . read ( ) hasher . update ( buf ) return hasher . hexdigest ( )
return a md5 hashdigest for a file .