def METHOD_NAME(filename: Union[Path, str]) -> Md5Result:
    """
    Return the MD5 check-sum of a given file without reading the entire file
    into memory.
    Args:
        filename    Filename to hash
    Returns:
        Md5Result tuple containing the length and the hex digest of the file.
    """
    with open(filename, mode="rb") as f:
        d = hashlib.md5()
        length = 0
        for buf in iter(partial(f.read, 2**20), b""):
            length += len(buf)
            d.update(buf)
    return Md5Result(length=length, md5_hash=d.hexdigest())