Implementation of CRC16 using polynomial 0x8005 = X^16 + X^15 + X^2 + 1
Dependents: Manchester_Transmitter Manchester_Receiver ManchesterUART_Transmitter ManchesterUART_Receiver
Fork of CRC16 by
Diff: CRC16.h
- Revision:
- 1:352debdce7b3
- Parent:
- 0:585ead300cab
- Child:
- 2:a01521fb2fe1
diff -r 585ead300cab -r 352debdce7b3 CRC16.h --- a/CRC16.h Wed Feb 12 21:34:53 2014 +0000 +++ b/CRC16.h Thu May 18 10:44:35 2017 +0000 @@ -1,15 +1,21 @@ +/* + * 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 + */ + #ifndef CRC16_H #define CRC16_H -class CRC16 +class CRC16 { - private: - const unsigned int SHIFTER = 0x00FF; - unsigned short crc16table[256]; - - public: - unsigned short calculateCRC16(char input[], int lenght); - CRC16(); - ~CRC16(); +private: + static const unsigned int SHIFTER; + static const unsigned short TABLE[]; +public: + CRC16(void) { }; + ~CRC16(void){ }; + unsigned short calc(char input[], int lenght); }; -#endif \ No newline at end of file +#endif // CRC16_H