def calc_crc(raw_mac):
        """
        This algorithm is the equivalent of esp_crc8() in ESP32 ROM code

        This is CRC-8 w/ inverted polynomial value 0x8C & initial value 0x00.
        """
        result = 0x00
        for b in struct.unpack("B" * 6, raw_mac):
            result ^= b
            for _ in range(8):
                lsb = result & 1
                result >>= 1
                if lsb != 0:
                    result ^= 0x8c
        return result
def calc_crc ( raw_mac ) : result = 0x00 for b in struct . unpack ( "B" * 6 , raw_mac ) : result ^= b for _ in range ( 8 ) : lsb = result & 1 result >>= 1 if lsb != 0 : result ^= 0x8c return result
This algorithm is the equivalent of esp_crc8() in ESP32 ROM code

        This is CRC-8 w/ inverted polynomial value 0x8C & initial value 0x00.