qt checksum
I’am trying to use the cecksum of QT – qchecksum [doc.qt.nokia.com]
According to the document, this function use CRC-16-CCITT algorithm.
but when I use this function, I don’t get the correct crc.
for example:
- char str[]= "123456789";
- quint16 qchecksum = qChecksum(str,9);
qchecksum = 0×906E.
but the correct checksum shold be 0×31C3 according to some calculator of checksum and other documents.
does anyone know how to use this function?
[EDIT: fixed link, Volker]
1 reply
If you look at Appendix A [regregex.bbcmicro.net] of http://regregex.bbcmicro.net/crc-catalogue.htm you can see a map of checksums using various parameters for the CRC algorithms.
0×31C3 is the result of using an initial value of 0×0000, a final XOR with 0×0000, a polynom of 0×1021 and not using reflection – aka XMODEM
0×906E, the Qt result, is for using an initial value of 0xFFFF, a final XOR with 0xFFFF, polynom 0×1021 and using reflection – aka X.25
So, it’s extremely important to use the very same parameters to calculate the checksum.
You must log in to post a reply. Not a member yet? Register here!


