Jens Axboe | 1e154bd | 2007-07-27 09:52:40 +0200 | [diff] [blame] | 1 | #ifndef CRC7_H |
2 | #define CRC7_H | ||||
3 | |||||
4 | extern const unsigned char crc7_syndrome_table[256]; | ||||
5 | |||||
6 | static inline unsigned char crc7_byte(unsigned char crc, unsigned char data) | ||||
7 | { | ||||
8 | return crc7_syndrome_table[(crc << 1) ^ data]; | ||||
9 | } | ||||
10 | |||||
11 | extern unsigned char crc7(const unsigned char *buffer, unsigned int len); | ||||
12 | |||||
13 | #endif |