1 /*
2  * crc.h
3  *
4  * This file contains macros for computing CRC-checksums using a lookup-table
5  * which has to be initialized using a function in crc.c
6  *
7  * (C) by Peter Conrad <conrad@unix-ag.uni-kl.de>
8  *
9  * $Id: crc.h,v 1.3 1997/09/18 18:12:31 lucifer Release1_2_1 $
10  *
11  * $Log: crc.h,v $
12  * Revision 1.3  1997/09/18 18:12:31  lucifer
13  * Added _CRC_H
14  *
15  * Revision 1.2  1996/06/12 09:38:17  conrad
16  * Release version
17  *
18  * Revision 1.1  1996/06/10 17:34:40  conrad
19  * Initial revision
20  *
21  */
22 
23 #ifndef _CRC_H
24 #define _CRC_H
25 
26 #define	crcword		unsigned int
27 
28 extern void mkCrcTab( );
29 
30 extern crcword	crctab[256], crcinvtab[256];
31 
32 #define CRCPOLY	0xedb88320
33 
34 #define CRC32(x,c)	(((x)>>8)^crctab[((x)^(c))&0xff])
35 #define	INVCRC32(x,c)	(((x)<<8)^crcinvtab[((x)>>24)&0xff]^((c)&0xff))
36 
37 #endif /* _CRC_H */
38