Botan  1.10.9
crc32.h
Go to the documentation of this file.
1 /*
2 * CRC32
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7 
8 #ifndef BOTAN_CRC32_H__
9 #define BOTAN_CRC32_H__
10 
11 #include <botan/hash.h>
12 
13 namespace Botan {
14 
15 /**
16 * 32-bit cyclic redundancy check
17 */
18 class BOTAN_DLL CRC32 : public HashFunction
19  {
20  public:
21  std::string name() const { return "CRC32"; }
22  size_t output_length() const { return 4; }
23  HashFunction* clone() const { return new CRC32; }
24 
25  void clear() { crc = 0xFFFFFFFF; }
26 
27  CRC32() { clear(); }
28  ~CRC32() { clear(); }
29  private:
30  void add_data(const byte[], size_t);
31  void final_result(byte[]);
32  u32bit crc;
33  };
34 
35 }
36 
37 #endif
void clear()
Definition: crc32.h:25
size_t output_length() const
Definition: crc32.h:22
~CRC32()
Definition: crc32.h:28
unsigned char byte
Definition: types.h:22
std::string name() const
Definition: crc32.h:21
HashFunction * clone() const
Definition: crc32.h:23
unsigned int u32bit
Definition: types.h:32