libdrmconf 0.12.1
A library to program DMR radios.
Loading...
Searching...
No Matches
crc32.hh
1#ifndef CRC32_HH
2#define CRC32_HH
3
4#include <QByteArray>
5
9class CRC32
10{
11public:
13 CRC32();
15 void update(uint8_t c);
17 void update(const uint8_t *c, size_t n);
19 void update(const QByteArray &data);
21 inline uint32_t get() { return _crc; }
22
23protected:
25 uint32_t _crc;
26};
27
28#endif // CRC32_HH
Implements the CRC32 checksum as used in DFU files.
Definition crc32.hh:10
CRC32()
Default constructor.
Definition crc32.cc:51
uint32_t get()
Returns the current CRC.
Definition crc32.hh:21
void update(uint8_t c)
Update CRC with given byte.
Definition crc32.cc:58
uint32_t _crc
Current CRC.
Definition crc32.hh:25