srecord: adler32.h Source File

srecord 1.65.0

Loading...
Searching...
No Matches
adler32.h
Go to the documentation of this file.
1//
2// srecord - Manipulate EPROM load files
3// Copyright (C) 2009-2011 Peter Miller
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation; either version 3 of the License, or (at
8// your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13// General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17//
18
19#ifndef SRECORD_ADLER32_H
20#define SRECORD_ADLER32_H
21
22#include <cstddef>
23
24namespace srecord
25{
26
27/**
28 * The adler32 class is used to represent the running value of a 32-bit
29 * Adler checksum of series of bytes.
30 *
31 * See wikipedia for a description
32 * http://en.wikipedia.org/wiki/Adler-32
33 */
34 class adler32
35{
36public:
37 /**
38 * The destructor.
39 */
40 virtual ~adler32();
41
42 /**
43 * The default constructor.
44 */
45 adler32();
46
47 /**
48 * The copy constructor.
49 */
50 adler32(const adler32 &);
51
52 /**
53 * The assignment operator.
54 */
55 adler32 &operator=(const adler32 &);
56
57 /**
58 * The get method is used to obtain the running value of the
59 * checksum.
60 */
61 unsigned long get() const;
62
63 /**
64 * The next method is used to advance the state by one byte.
65 */
66 void next(unsigned char);
67
68 /**
69 * The nextbuf method is used to advance the state by a series of bytes.
70 */
71 void nextbuf(const void *, size_t);
72
73private:
74 /**
75 * The sum_a instance variable is used to remember the sum of bytes
76 * scanned.
77 */
78 unsigned short sum_a;
79
80 /**
81 * The sum_b instance variable is used to remember the sum of the
82 * sum of bytes scanned.
83 */
84 unsigned short sum_b;
85};
86
87};
88
89// vim: set ts=8 sw=4 et :
90#endif // SRECORD_ADLER32_H
srecord::adler32::~adler32
virtual ~adler32()
The destructor.
srecord::adler32::nextbuf
void nextbuf(const void *, size_t)
The nextbuf method is used to advance the state by a series of bytes.
srecord::adler32::adler32
adler32()
The default constructor.
srecord::adler32::get
unsigned long get() const
The get method is used to obtain the running value of the checksum.
srecord::adler32::next
void next(unsigned char)
The next method is used to advance the state by one byte.
srecord::adler32::adler32
adler32(const adler32 &)
The copy constructor.
srecord::adler32::operator=
adler32 & operator=(const adler32 &)
The assignment operator.
srecord
Definition adler16.h:25