13 static UInt32 Table[256];
14 static void InitTable();
16 CCRC(): _value(0xFFFFFFFF){};
17 void Init() { _value = 0xFFFFFFFF; }
18 void UpdateByte(Byte v);
19 void UpdateUInt16(UInt16 v);
20 void UpdateUInt32(UInt32 v);
21 void UpdateUInt64(UInt64 v);
22 void Update(const void *data, size_t size);
23 UInt32 GetDigest() const { return _value ^ 0xFFFFFFFF; }
24 static UInt32 CalculateDigest(const void *data, size_t size)
27 crc.Update(data, size);
28 return crc.GetDigest();
30 static bool VerifyDigest(UInt32 digest, const void *data, size_t size)
32 return (CalculateDigest(data, size) == digest);