File indexing completed on 2025-01-26 04:24:53

0001 #ifndef QUACRC32_H
0002 #define QUACRC32_H
0003 
0004 /*
0005 Copyright (C) 2005-2014 Sergey A. Tachenov
0006 
0007 This file is part of QuaZIP.
0008 
0009 QuaZIP is free software: you can redistribute it and/or modify
0010 it under the terms of the GNU Lesser General Public License as published by
0011 the Free Software Foundation, either version 2.1 of the License, or
0012 (at your option) any later version.
0013 
0014 QuaZIP is distributed in the hope that it will be useful,
0015 but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 GNU Lesser General Public License for more details.
0018 
0019 You should have received a copy of the GNU Lesser General Public License
0020 along with QuaZIP.  If not, see <http://www.gnu.org/licenses/>.
0021 
0022 See COPYING file for the full LGPL text.
0023 
0024 Original ZIP package is copyrighted by Gilles Vollant and contributors,
0025 see quazip/(un)zip.h files for details. Basically it's the zlib license.
0026 */
0027 
0028 #include "quachecksum32.h"
0029 
0030 ///CRC32 checksum
0031 /** \class QuaCrc32 quacrc32.h <quazip/quacrc32.h>
0032 * This class wrappers the crc32 function with the QuaChecksum32 interface.
0033 * See QuaChecksum32 for more info.
0034 */
0035 class QUAZIP_EXPORT QuaCrc32 : public QuaChecksum32 {
0036 
0037 public:
0038     QuaCrc32();
0039 
0040     quint32 calculate(const QByteArray &data);
0041 
0042     void reset();
0043     void update(const QByteArray &buf);
0044     quint32 value();
0045 
0046 private:
0047     quint32 checksum;
0048 };
0049 
0050 #endif //QUACRC32_H