QuaZip quazip-1-4
quaadler32.h
1#ifndef QUAADLER32_H
2#define QUAADLER32_H
3
4/*
5Copyright (C) 2010 Adam Walczak
6Copyright (C) 2005-2014 Sergey A. Tachenov
7
8This file is part of QuaZip.
9
10QuaZip is free software: you can redistribute it and/or modify
11it under the terms of the GNU Lesser General Public License as published by
12the Free Software Foundation, either version 2.1 of the License, or
13(at your option) any later version.
14
15QuaZip is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU Lesser General Public License for more details.
19
20You should have received a copy of the GNU Lesser General Public License
21along with QuaZip. If not, see <http://www.gnu.org/licenses/>.
22
23See COPYING file for the full LGPL text.
24
25Original ZIP package is copyrighted by Gilles Vollant and contributors,
26see quazip/(un)zip.h files for details. Basically it's the zlib license.
27*/
28
29#include <QtCore/QByteArray>
30
31#include "quachecksum32.h"
32
34
38class QUAZIP_EXPORT QuaAdler32 : public QuaChecksum32
39{
40
41public:
42 QuaAdler32();
43
44 quint32 calculate(const QByteArray &data) override;
45
46 void reset() override;
47 void update(const QByteArray &buf) override;
48 quint32 value() override;
49
50private:
51 quint32 checksum;
52};
53
54#endif //QUAADLER32_H
Adler32 checksum.
Definition: quaadler32.h:39
Checksum interface.
Definition: quachecksum32.h:53
virtual quint32 calculate(const QByteArray &data)=0
Calculates the checksum for data.
virtual void update(const QByteArray &buf)=0
Updates the calculated checksum for the stream.
virtual void reset()=0
Resets the calculation on a checksun for a stream.
virtual quint32 value()=0
Value of the checksum calculated for the stream passed throw update().