1#ifndef CRYPTOPP_ADLER32_H 2#define CRYPTOPP_ADLER32_H 3 4#include "cryptlib.h" 5 6NAMESPACE_BEGIN(CryptoPP) 7 8//! ADLER-32 checksum calculations 9class Adler32 : public HashTransformation 10{ 11public: 12 CRYPTOPP_CONSTANT(DIGESTSIZE = 4) 13 Adler32() {Reset();} 14 void Update(const byte *input, size_t length); 15 void TruncatedFinal(byte *hash, size_t size); 16 unsigned int DigestSize() const {return DIGESTSIZE;} 17 static const char * StaticAlgorithmName() {return "Adler32";} 18 std::string AlgorithmName() const {return StaticAlgorithmName();} 19 20private: 21 void Reset() {m_s1 = 1; m_s2 = 0;} 22 23 word16 m_s1, m_s2; 24}; 25 26NAMESPACE_END 27 28#endif 29