RIT VEXU Core API
Loading...
Searching...
No Matches
CRC32 Class Reference

A class for calculating the CRC32 checksum from arbitrary data. More...

#include <crc32.h>

Public Member Functions

constexpr CRC32 ()
 Initialize an empty CRC32 checksum.
void constexpr reset ()
 Reset the checksum claculation.
void constexpr update (const uint8_t &data)
 Update the current checksum caclulation with the given data.
template<typename Type>
void update (const Type &data)
 Update the current checksum caclulation with the given data.
template<typename Type>
void constexpr update (const Type *data, std::size_t size)
 Update the current checksum caclulation with the given data.
uint32_t constexpr finalize () const

Static Public Member Functions

template<typename Type>
static constexpr uint32_t calculate (const Type *data, std::size_t size)
 Calculate the checksum of an arbitrary data array.

Detailed Description

A class for calculating the CRC32 checksum from arbitrary data.

See also
http://forum.arduino.cc/index.php?topic=91179.0

Member Function Documentation

◆ calculate()

template<typename Type>
constexpr uint32_t CRC32::calculate ( const Type * data,
std::size_t size )
inlinestaticconstexpr

Calculate the checksum of an arbitrary data array.

Parameters
TypeThe data type to read.
dataA pointer to the data to add to the checksum.
sizeThe size of the data to add to the checksum.
Returns
the calculated checksum.

◆ finalize()

uint32_t constexpr CRC32::finalize ( ) const
inlineconstexpr
Returns
the caclulated checksum.

◆ update() [1/3]

template<typename Type>
void CRC32::update ( const Type & data)
inline

Update the current checksum caclulation with the given data.

Parameters
TypeThe data type to read.
dataThe data to add to the checksum.

◆ update() [2/3]

template<typename Type>
void constexpr CRC32::update ( const Type * data,
std::size_t size )
inlineconstexpr

Update the current checksum caclulation with the given data.

Parameters
TypeThe data type to read.
dataThe array to add to the checksum.
sizeSize of the array to add.

◆ update() [3/3]

void constexpr CRC32::update ( const uint8_t & data)
inlineconstexpr

Update the current checksum caclulation with the given data.

Parameters
dataThe data to add to the checksum.

The documentation for this class was generated from the following file: