Zoltan Hudak / CRC16

Dependents:   Manchester_Transmitter Manchester_Receiver ManchesterUART_Transmitter ManchesterUART_Receiver

Fork of CRC16 by Emilie Laverge

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CRC16.h Source File

CRC16.h

00001 /*
00002  * This is a fork of the CRC16 library COPYRIGHT(c) Emilie Laverge
00003  * published at [https://developer.mbed.org/users/EmLa/code/CRC16/]
00004  * using the polynomial 0x8005: X^16 + X^15 + X^2 + 1.
00005  * Default initial CRC value = 0x0000
00006  *
00007  * Modified by Zoltan Hudak
00008  */
00009 
00010 #ifndef CRC16_H
00011 #define CRC16_H
00012 
00013 class   CRC16
00014 {
00015 private:
00016     static const unsigned int   SHIFTER;
00017     static const unsigned short TABLE[];
00018 public:
00019     CRC16(void){};
00020     ~CRC16(void){};
00021     unsigned short calc(char input[], int length, unsigned short crc = 0x0000);
00022 };
00023 #endif // CRC16_H