21 void update(
const uint8_t &data);
27 template <
typename Type>
void update(
const Type &data) {
update(&data, 1); }
34 template <
typename Type>
void update(
const Type *data, std::size_t size) {
35 std::size_t nBytes = size *
sizeof(Type);
36 const uint8_t *pData = (
const uint8_t *)data;
38 for (std::size_t i = 0; i < nBytes; i++) {
53 template <
typename Type>
static uint32_t
calculate(
const Type *data, std::size_t size) {
63 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:53
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:27
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:34
uint32_t finalize() const
Definition crc32.cpp:23