def md5sum(filename):
    """Calculate the md5sum of a file and return the hexdigest."""
    hash_md5 = hashlib.md5()
    with open(filename, 'rb') as handle:
        for chunk in iter(lambda: handle.read(4096), b''):
            hash_md5.update(chunk)
    return hash_md5.hexdigest()
def md5sum ( filename ) : hash_md5 = hashlib . md5 ( ) with open ( filename , 'rb' ) as handle : for chunk in iter ( lambda : handle . read ( 4096 ) , b'' ) : hash_md5 . update ( chunk ) return hash_md5 . hexdigest ( )
Calculate the md5sum of a file and return the hexdigest.