File: crc32.h

package info (click to toggle)
bglibs 2.04%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,468 kB
  • sloc: ansic: 15,821; perl: 674; sh: 63; makefile: 29
file content (16 lines) | stat: -rw-r--r-- 433 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef CRC32__H__
#define CRC32__H__

#include "gcrc.h"
#include "uint32.h"

#define CRC32POLY    ((uint32)0x04C11DB7UL)
#define CRC32REVPOLY ((uint32)0xEDB88320UL)
#define CRC32INIT    ((uint32)0xFFFFFFFFUL)
#define CRC32POST    ((uint32)0xFFFFFFFFUL)

extern const uint32 crc32_table[256];
#define crc32_update(C,D,L) gcrc32rfl((C),(D),(L),crc32_table)
#define crc32_block(B,L) (crc32_update(CRC32INIT,(B),(L))^CRC32POST)

#endif