DUNE: Uniform Navigational Environment  2020.01.0
DUNE::Algorithms::CRC32 Class Reference

Detailed Description

CRC-32 Algorithm.

The polynomial used is x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + 1 (0x04C11DB7)

Static Public Member Functions

static uint32_t reflect (uint32_t data, const uint8_t len)
 
static uint32_t compute (const uint8_t *buf, const uint8_t len, bool do_reflect, uint32_t crc=0)
 

Member Function Documentation

static uint32_t DUNE::Algorithms::CRC32::compute ( const uint8_t *  buf,
const uint8_t  len,
bool  do_reflect,
uint32_t  crc = 0 
)
inlinestatic

Compute the CRC-32 of a given data buffer.

Parameters
bufferdata buffer.
lendata buffer length.
do_reflectif true, the intermediate results are reflected
crcCRC-32 value to update.
Returns
computed CRC-32.

References reflect().

static uint32_t DUNE::Algorithms::CRC32::reflect ( uint32_t  data,
const uint8_t  len 
)
inlinestatic

Referenced by compute().

Collaboration diagram for DUNE::Algorithms::CRC32:
Collaboration graph