(path)
return hasher.hexdigest()
Compute the sha256 checksum of a path
Compute the sha256 checksum of a path
Compute the sha256 checksum of a path
def checksum_file(path):
    """Compute the sha256 checksum of a path"""
    hasher = hashlib.sha256()
    with open(path, "rb") as f:
        for chunk in iter(lambda: f.read(4096), b""):
            hasher.update(chunk)
    return hasher.hexdigest()
def checksum_file ( path ) : hasher = hashlib . sha256 ( ) with open ( path , "rb" ) as f : for chunk in iter ( lambda : f . read ( 4096 ) , b"" ) : hasher . update ( chunk ) return hasher . hexdigest ( )