quaadler32.h 1.4 KB

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