def _update_sha256(filename, sha256):
    """
    Updates a SHA-256 algorithm with the filename and the contents of a file.
    """
    block_size = 64 * 1024  # 64 KB
    with open(filename, 'rb') as input_file:
        while True:
            data = input_file.read(block_size)
            if not data:
                break
            sha256.update(data)
    sha256.update(filename.encode("utf-8"))
    return sha256