79788560

Date: 2025-10-12 12:46:00
Score: 1
Natty:
Report link

https://reveng.sourceforge.io/crc-catalogue/16.htm
See CRC-16/IBM-3740

This C++ code works

// width=16 poly=0x1021 init=0xffff refin=false refout=false xorout=0x0000 check=0x29b1 residue=0x0000 name="CRC-16/IBM-3740"
// Alias : CRC-16/AUTOSAR, CRC-16/CCITT-FALSE
unsigned short crc16ccitFalse (const char *pData, unsigned int length, unsigned short initVal /*= 0xFFFF*/)
{
    const unsigned short polynomial = 0x1021;
    unsigned short crc = initVal;
    for (unsigned byte = 0; byte < length; ++byte) {
        crc ^= (pData [byte] << 8);
        for (int bit = 0; bit < 8; ++bit) {
            crc = (crc & 0x8000) ? (crc << 1) ^ polynomial : (crc << 1);
        }
    }
    return crc;
}
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Vasyl Androshchook