31 lines
601 B
C++
31 lines
601 B
C++
#ifndef CRC_HPP
|
|
#define CRC_HPP
|
|
|
|
class CRC{
|
|
|
|
private:
|
|
|
|
static const unsigned int CRC32_POLYNOMIAL;
|
|
|
|
static const unsigned int CRC32_POLYNOMIAL_DRF;
|
|
|
|
unsigned int* crc32_table=0;
|
|
|
|
public:
|
|
|
|
static const unsigned int CRC_MODE_DEFAULT;
|
|
|
|
static const unsigned int CRC_MODE_DRF;
|
|
|
|
unsigned int update_crc32(const unsigned char* data, unsigned int dataLength, unsigned int old_crc32);
|
|
|
|
unsigned int getCRC32(const unsigned char* data, unsigned int dataLength);
|
|
|
|
CRC(unsigned int mode=CRC::CRC_MODE_DEFAULT);
|
|
|
|
~CRC();
|
|
|
|
};
|
|
|
|
#endif
|