ushort ComputeCRC16(const uchar* buf, uint len)
{
ushort crc = 0;
for (uint j = 0; j < len; j++)
{
uchar b = buf[j];
for (uchar i = 0; i < 8; i++)
{
crc = ((b ^ (uchar)crc) & 1) ? ((crc >> 1) ^ 0xA001) : (crc >> 1);
b >>= 1;
}
}
return crc;
}
Tuesday, April 07, 2009
CRC16 - IBM
http://www.codeguru.com/forum/showthread.php?referrerid=177422&t=433491
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment