20 void update(
const uint8_t &data);
26 template <
typename Type>
void update(
const Type &data) {
update(&data, 1); }
33 template <
typename Type>
void update(
const Type *data, std::size_t size) {
34 std::size_t nBytes = size *
sizeof(Type);
35 const uint8_t *pData = (
const uint8_t *)data;
37 for (std::size_t i = 0; i < nBytes; i++) {
52 template <
typename Type>
static uint32_t
calculate(
const Type *data, std::size_t size) {
62 uint32_t _state = ~0L;
static uint32_t calculate(const Type *data, std::size_t size)
Calculate the checksum of an arbitrary data array.
Definition crc32.hpp:52
CRC32()
Initialize an empty CRC32 checksum.
Definition crc32.cpp:9
void update(const Type &data)
Update the current checksum caclulation with the given data.
Definition crc32.hpp:26
void reset()
Reset the checksum claculation.
Definition crc32.cpp:11
void update(const uint8_t &data)
Update the current checksum caclulation with the given data.
Definition crc32.cpp:13
void update(const Type *data, std::size_t size)
Update the current checksum caclulation with the given data.
Definition crc32.hpp:33
uint32_t finalize() const
Definition crc32.cpp:23