Can anybody help me in calculating CRC for stream of bytes using lookup table?

I need to calculate CRC for a given stream of bytes. I was asked to follow the table method so that it consumes less number of machine cycles. So, I have created a lookup table which has all the remainders of 0x to 0xff. My calculations are correct only for one byte. How to cumulatively calculate the value for any number of bytes using the same table? Can anybody help me in calculating CRC for stream of bytes (atleast for two bytes)?

For example, if input data stream (in hex) is 0x0A, 0x75, then the CRC value for it using the polynomial 0x01864CFB is 0x306B8E.

✅ Answers

? Best Answer

  • Perhaps you need to make much bigger tables… tables of bytes.

    You’re thinking too small. You should be created tables of 16 bytes by 16 bytes. (then you can process your stream 16 bytes at a time)

  • Leave a Comment