NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Typedefs | Functions | Variables
crc.h File Reference

Go to the source code of this file.

Macros

#define CRC_FALSE   0
 
#define CRC_TRUE   !CRC_FALSE
 
#define CRC32
 
#define CRC_NAME   "CRC-32"
 
#define POLYNOMIAL   0x04C11DB7
 
#define INITIAL_REMAINDER   0xFFFFFFFF
 
#define FINAL_XOR_VALUE   0xFFFFFFFF
 
#define REFLECT_DATA   CRC_TRUE
 
#define REFLECT_REMAINDER   CRC_TRUE
 
#define CHECK_VALUE   0xCBF43926
 
#define WIDTH   (8 * sizeof(crc))
 
#define TOPBIT   (1 << (WIDTH - 1))
 
#define REFLECT_DATA(X)   ((unsigned char) reflect((X), 8))
 
#define REFLECT_REMAINDER(X)   ((crc) reflect((X), WIDTH))
 

Typedefs

typedef unsigned int crc
 

Functions

unsigned long reflect (unsigned long data, unsigned char nBits)
 
void crcInit (void)
 
template<typename CharIterator >
crc crcCalc (const CharIterator message, unsigned int nBytes)
 

Variables

crc crcTable [256]
 

Macro Definition Documentation

#define CHECK_VALUE   0xCBF43926

Definition at line 68 of file crc.h.

#define CRC32

Definition at line 29 of file crc.h.

#define CRC_FALSE   0

Definition at line 20 of file crc.h.

#define CRC_NAME   "CRC-32"

Definition at line 62 of file crc.h.

#define CRC_TRUE   !CRC_FALSE

Definition at line 23 of file crc.h.

#define FINAL_XOR_VALUE   0xFFFFFFFF

Definition at line 65 of file crc.h.

#define INITIAL_REMAINDER   0xFFFFFFFF

Definition at line 64 of file crc.h.

#define POLYNOMIAL   0x04C11DB7

Definition at line 63 of file crc.h.

#define REFLECT_DATA   CRC_TRUE

Definition at line 84 of file crc.h.

#define REFLECT_DATA (   X)    ((unsigned char) reflect((X), 8))

Definition at line 84 of file crc.h.

#define REFLECT_REMAINDER   CRC_TRUE

Definition at line 92 of file crc.h.

#define REFLECT_REMAINDER (   X)    ((crc) reflect((X), WIDTH))

Definition at line 92 of file crc.h.

#define TOPBIT   (1 << (WIDTH - 1))

Definition at line 80 of file crc.h.

#define WIDTH   (8 * sizeof(crc))

Definition at line 79 of file crc.h.

Typedef Documentation

typedef unsigned int crc

Definition at line 60 of file crc.h.

Function Documentation

template<typename CharIterator >
crc crcCalc ( const CharIterator  message,
unsigned int  nBytes 
)

Definition at line 116 of file crc.h.

void crcInit ( void  )

Definition at line 99 of file crc.cpp.

unsigned long reflect ( unsigned long  data,
unsigned char  nBits 
)

Definition at line 57 of file crc.cpp.

Variable Documentation

crc crcTable[256]

Definition at line 82 of file crc.cpp.