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