Click to See Complete Forum and Search --> : Regarding check sum algos.


omerash
October 20th, 2002, 05:49 PM
i need implementaion for
CRC_16 , CRC_32 and CCITT algorithms in c/c++ (Unix as operating system). I have searched a lot bt still hardly find any.

thanx in advance
omerash...

JMS
October 21st, 2002, 09:49 AM
check sum algorithms are very simple to implement. Here is the basic idea..

assign crc0 = datain ^ crc[4];

crc[4] <= crc[3];
crc[3] <= crc[2];
crc[2] <= crc[4] ^ crc[1];
crc[1] <= crc[0];
crc[0] <= crc[4] ^ datain;

The patern in which you combine the bits and perform the xor comparisons doesn't matter. What matters is you're consistant if you want the CRC value to be consistant. Likewise two crc values from different utilities are likely not to be the same.

Good luck..