00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _OASYS_CRC32_H_
00020 #define _OASYS_CRC32_H_
00021
00022 #include <sys/types.h>
00023 #include "../compat/inttypes.h"
00024
00025 namespace oasys {
00026 class CRC32 {
00027 public:
00028 CRC32();
00029
00030 typedef u_int32_t CRC_t;
00031
00035 void update(const u_char* buf, size_t length);
00036 void update(const char* buf, size_t length) {
00037 update((const u_char*)buf, length);
00038 }
00041 CRC_t value();
00042 void reset();
00043
00044 static CRC_t from_bytes(u_char* buf);
00045
00046 private:
00047 CRC_t crc_;
00048 };
00049 };
00050
00051 #endif //_OASYS_CRC32_H_