libdrmconf  0.10.4
A library to program DMR radios.
crc32.hh
1 #ifndef CRC32_HH
2 #define CRC32_HH
3 
4 #include <QByteArray>
5 
9 class CRC32
10 {
11 public:
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 
23 protected:
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