| 166 | static const uint8_t crc4_table[16] = {0, 3, 6, 5, 12, 15, 10, 9, 11, 8, 13, 14, 7, 4, 1, 2}; |
| 167 | |
| 168 | static uint32_t getcrc4(void *data, uint32_t len) { // RETURN 4 bit crc |
| 169 | uint8_t *p = (uint8_t *) data; |
| 170 | |
| 171 | uint8_t crc = 0; |
| 172 | for (uint32_t k = 0; k < len; k++) { |
| 173 | crc ^= p[k] >> 4; |
| 174 | crc = crc4_table[crc]; |
| 175 | crc ^= p[k] & 0xF; |
| 176 | crc = crc4_table[crc]; |
| 177 | } |
| 178 | return crc; |
| 179 | } |
| 180 | |
| 181 | static unsigned int Crc32Table[256] = {0}; |
| 182 |
nothing calls this directly
no outgoing calls
no test coverage detected