2 * crc16.h - CRC-16 routine
4 * Implements the standard CRC-16:
6 * Poly 0x8005 (x^16 + x^15 + x^2 + 1)
9 * Copyright (c) 2005 Ben Gardner <bgardner@wabtec.com>
11 * This source code is licensed under the GNU General Public License,
12 * Version 2. See the file COPYING for more details.
18 extern unsigned short const crc16_table[256];
20 extern unsigned short crc16(const void *buffer, unsigned int len);
22 static inline unsigned short crc16_byte(unsigned short crc,
23 const unsigned char data)
25 return (crc >> 8) ^ crc16_table[(crc ^ data) & 0xff];
28 #endif /* __CRC16_H */