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