Implementation of CRC16-CCITT using polynomial 0x1021 = x^16 + x^12 + x^5 + 1
CRC16_CCITT.h
- Committer:
- hudakz
- Date:
- 2017-09-02
- Revision:
- 0:253105d48c3c
- Child:
- 1:6ecc3a64bf7b
File content as of revision 0:253105d48c3c:
/* * This is a fork of the CRC16 library COPYRIGHT(c) Emilie Laverge * published at [https://developer.mbed.org/users/EmLa/code/CRC16/] * * Modified by Zoltan Hudak to implement CRC16-CCITT * using the polynomial 0x1021: X^16 + X^15 + X^2 + 1. * Initial CRC register = 0x0000 */ #ifndef CRC16_CCITT_H #define CRC16_CCITT_H class CRC16_CCITT { private: static const unsigned int SHIFTER; static const unsigned short TABLE[]; public: CRC16_CCITT(void) { }; ~CRC16_CCITT(void){ }; unsigned short calc(char input[], int length); }; #endif // CRC16_CCITT_H