"Fossies" - the Fresh Open Source Software Archive

Member "mkvtoolnix-35.0.0/src/common/checksums/adler32.h" (22 Jun 2019, 846 Bytes) of package /linux/misc/mkvtoolnix-35.0.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "adler32.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2    mkvmerge -- utility for splicing together matroska files
    3    from component media subtypes
    4 
    5    Distributed under the GPL v2
    6    see the file COPYING for details
    7    or visit http://www.gnu.org/copyleft/gpl.html
    8 
    9    checksum calculations – Adler-32 definition
   10 
   11    Written by Moritz Bunkus <moritz@bunkus.org>.
   12 */
   13 
   14 #pragma once
   15 
   16 #include "common/common_pch.h"
   17 
   18 #include "common/checksums/base.h"
   19 
   20 namespace mtx { namespace checksum {
   21 
   22 class adler32_c: public base_c, public uint_result_c {
   23 protected:
   24   static uint32_t const msc_mod_adler = 65521;
   25   uint32_t m_a, m_b;
   26 
   27 public:
   28   adler32_c();
   29   virtual ~adler32_c() = default;
   30 
   31   virtual memory_cptr get_result() const;
   32   virtual uint64_t get_result_as_uint() const;
   33 
   34 protected:
   35   virtual void add_impl(unsigned char const *buffer, size_t size);
   36 };
   37 
   38 }} // namespace mtx { namespace checksum {