diff options
author | lloyd <[email protected]> | 2015-02-05 07:44:25 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-02-05 07:44:25 +0000 |
commit | cb0f83ae63c4555cbdd0607e3a5f6e9260c0d19c (patch) | |
tree | 4981027a25fa8074177b97c3a3ca7431f3337deb /src/lib/hash/checksum/crc32/crc32.h | |
parent | 2c14faf0aa1cfe0f8d70af1938dcad5b4d6d3b59 (diff) |
Clean up root dir, remove some unneeded dependencies
Diffstat (limited to 'src/lib/hash/checksum/crc32/crc32.h')
-rw-r--r-- | src/lib/hash/checksum/crc32/crc32.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/lib/hash/checksum/crc32/crc32.h b/src/lib/hash/checksum/crc32/crc32.h new file mode 100644 index 000000000..503b18b7a --- /dev/null +++ b/src/lib/hash/checksum/crc32/crc32.h @@ -0,0 +1,37 @@ +/* +* CRC32 +* (C) 1999-2007 Jack Lloyd +* +* Botan is released under the Simplified BSD License (see license.txt) +*/ + +#ifndef BOTAN_CRC32_H__ +#define BOTAN_CRC32_H__ + +#include <botan/hash.h> + +namespace Botan { + +/** +* 32-bit cyclic redundancy check +*/ +class BOTAN_DLL CRC32 : public HashFunction + { + public: + std::string name() const { return "CRC32"; } + size_t output_length() const { return 4; } + HashFunction* clone() const { return new CRC32; } + + void clear() { crc = 0xFFFFFFFF; } + + CRC32() { clear(); } + ~CRC32() { clear(); } + private: + void add_data(const byte[], size_t); + void final_result(byte[]); + u32bit crc; + }; + +} + +#endif |