Thursday, September 26, 2013

CRC-CCITT Kermit 16 C++ Qt Implementation

CRC-CCITT Kermit 16 C++

Once I was needed to find CRC-CCITT Kermit 16 algo realization in C++. So here I found source code in Delphi and converted it to the C/C++ code (also for Qt).

Hope, that it will help you, guys.

C++11x and Qt


#include <QtCore>

quint16 makeCrc16Kermit(const QByteArray &data)
{
    quint16     valuehex = 0;
    quint16     CRC = 0;
    int         size = data.size();
    CRC = 0;