@staticmethod
def crc32_xfer(data):
    """
        Returns the 32 bit CRC (XFER algorithm) of the provided bytes

        Compatible with CRC-32/XFER from https://crccalc.com/?method=crc32
        If the returned crc is appended to the original data and run back through
        this function the result will be 0.
        :param bytes,bytearray data: bytes to calculate crc on
        :return int: crc of input data
        """
    data = data.encode() if isinstance(data, str) else data
    _poly = 175
    crc = 0
    highbit = 1 << 32 - 1
    mask = highbit - 1 << 1 | 1
    poly = _poly
    shift = 32 - 8
    diff8 = -shift
    if diff8 > 0:
        mask = 255
        crc <<= diff8
        shift = 0
        highbit = 128
        poly = _poly << diff8
    for byte in data:
        crc ^= byte << shift
        for i in range(8):
            if crc & highbit:
                crc = crc << 1 ^ poly
            else:
                crc = crc << 1
        crc &= mask
    if diff8 > 0:
        crc >>= diff8
    return crc
