2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2011-02-25 01:05:47 +03:00
|
|
|
// $Id$
|
2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2001-06-18 02:39:57 +04:00
|
|
|
/* CRC-32 calculator
|
|
|
|
* Adapted from http://www.createwindow.org/programming/crc32/
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CRC_32_H_
|
|
|
|
#define _CRC_32_H_
|
|
|
|
|
2006-03-07 21:16:41 +03:00
|
|
|
#include "config.h"
|
2001-06-18 03:08:27 +04:00
|
|
|
|
2001-06-18 02:39:57 +04:00
|
|
|
class CRC_Generator {
|
|
|
|
private:
|
|
|
|
Bit32u crc32_table[256];
|
|
|
|
Bit32u reflect(Bit32u ref, Bit8u ch);
|
|
|
|
public:
|
|
|
|
void init(void);
|
|
|
|
CRC_Generator();
|
|
|
|
Bit32u get_CRC(Bit8u * buf, Bit32u buflen);
|
2001-06-18 03:08:27 +04:00
|
|
|
};
|
2001-06-18 02:39:57 +04:00
|
|
|
|
|
|
|
#endif //_CRC_32_H_
|
|
|
|
|