I am developing a program to transmit data using the APRS AX.25 protocol and have reached the final component: the Frame Check Sequence (FCS). After researching, I found that the CRC16-CCITT algorithm is commonly used for LoRa modules transmitting data. Based on several recommendations, I explored the Dire Wolf’s repository to understand its implementation of the algorithm.
I understand generally how CRC algorithms work, but my confusion with their implementation (the function named fcs_calc
) resides mostly with the reasoning behind this line of code:
ccitt_table[((crc) ^ data[j]) & 0xff]
Why exactly are they doing a table lookup and how does it work to help compute the FCS?