Main Site Documentation

CRC16 Problem


#1

I can not seem to understand why the method CRC.CRC_16_CCITT Method needs (ushort seed).
That there should be introduced! :’(


#2

Just use zero.

Welcome to the community.


#3

Are you sure Gus?

Isn’t CRC ccitt initialized with 0xFFFF?

I succesfully used it this way:


/// <summary>
/// Initialise the CRC value.
/// </summary>
public void InitCrc()
{
    crcReg = 0xFFFF;
}

And then update the crc:


crcReg = CRC.CRC_16_CCITT(buffer, 0, bufferLength, crcReg);


#4

Is it? I thought it was zero. Maybe you are right.