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

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

#include <crc32.hpp>

Public Member Functions

 CRC32 ()
 Initialize an empty CRC32 checksum.
 
void reset ()
 Reset the checksum claculation.
 
void 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 update (const Type *data, std::size_t size)
 Update the current checksum caclulation with the given data.
 
uint32_t finalize () const
 

Static Public Member Functions

template<typename Type>
static 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>
static uint32_t CRC32::calculate ( const Type * data,
std::size_t size )
inlinestatic

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 CRC32::finalize ( ) const
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 CRC32::update ( const Type * data,
std::size_t size )
inline

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 CRC32::update ( const uint8_t & data)

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 files: