File: crc7.h

package info (click to toggle)
fio 1.38-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,108 kB
  • ctags: 2,240
  • sloc: ansic: 17,668; makefile: 98; sh: 55
file content (13 lines) | stat: -rw-r--r-- 297 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef CRC7_H
#define CRC7_H

extern const unsigned char crc7_syndrome_table[256];

static inline unsigned char crc7_byte(unsigned char crc, unsigned char data)
{
	return crc7_syndrome_table[(crc << 1) ^ data];
}

extern unsigned char crc7(const unsigned char *buffer, unsigned int len);

#endif