bglibs: crc32.h Source File

bglibs

crc32.h
1 #ifndef CRC32__H__
2 #define CRC32__H__
3
4 #include "gcrc.h"
5 #include "uint32.h"
6
7 #define CRC32POLY ((uint32)0x04C11DB7UL)
8 #define CRC32REVPOLY ((uint32)0xEDB88320UL)
9 #define CRC32INIT ((uint32)0xFFFFFFFFUL)
10 #define CRC32POST ((uint32)0xFFFFFFFFUL)
11
12 extern const uint32 crc32_table[256];
13 #define crc32_update(C,D,L) gcrc32rfl((C),(D),(L),crc32_table)
14 #define crc32_block(B,L) (crc32_update(CRC32INIT,(B),(L))^CRC32POST)
15
16 #endif