+}
+
+//credits to iceman
+uint32_t CRC8Legic(uint8_t *buff, size_t size) {
+
+ // Poly 0x63, reversed poly 0xC6, Init 0x55, Final 0x00
+ crc_t crc;
+ crc_init(&crc, 8, 0xC6, 0x55, 0);
+ crc_clear(&crc);
+
+ for ( int i = 0; i < size; ++i)
+ crc_update(&crc, buff[i], 8);
+ return SwapBits(crc_finish(&crc), 8);
+}
+
+