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;
}