def _addsum(arr):
    """Compute the XOR checksum value.

    Parameters
    ----------
    arr : bytes, bytearray, or list of int
        Bytes to be addsum.

    Returns
    -------
    addsum: int
        the checksum byte as integer.
    """
    if not isinstance(arr, (bytes, bytearray, list)):
        raise TypeError("invalid type of arr:", type(arr))
    if len(arr) == 0:
        raise ValueError("empty array")
    arr = list(arr)
    addsum = arr[0]
    for byte in arr[1:]:
        addsum ^= byte
    return addsum