QuaZip  quazip-1-1
quaadler32.h
1 #ifndef QUAADLER32_H
2 #define QUAADLER32_H
3 
4 /*
5 Copyright (C) 2010 Adam Walczak
6 Copyright (C) 2005-2014 Sergey A. Tachenov
7 
8 This file is part of QuaZip.
9 
10 QuaZip is free software: you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation, either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 QuaZip is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with QuaZip. If not, see <http://www.gnu.org/licenses/>.
22 
23 See COPYING file for the full LGPL text.
24 
25 Original ZIP package is copyrighted by Gilles Vollant and contributors,
26 see 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 
38 class QUAZIP_EXPORT QuaAdler32 : public QuaChecksum32
39 {
40 
41 public:
42  QuaAdler32();
43 
44  quint32 calculate(const QByteArray &data);
45 
46  void reset();
47  void update(const QByteArray &buf);
48  quint32 value();
49 
50 private:
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().