import hashlib


def etag_checksum(filename: str, chunk_size: int = 8 * 1024 ** 2) -> str:
    """\
    Compute the `ETag` digest (which is not the `MD5` digest) of an object.

    :param filename:
        Path to file target file
    :param chunk_size:
        Chunk size to hash

    :return:
        `ETag` `hexdigest`
    """
    md5s = []
    with open(filename, "rb") as f:
        for data in iter(lambda: f.read(chunk_size), b""):
            md5s.append(hashlib.md5(data).digest())
    m = hashlib.md5(b"".join(md5s))
    return "{}-{}".format(m.hexdigest(), len(md5s)) if len(md5s) > 1 else m.hexdigest()