DUNE: Uniform Navigational Environment  2016.09.0
DUNE::Algorithms::CRC16 Class Reference

Detailed Description

CRC-16-IBM Algorithm.

The polynomial used is x^16 + x^15 + x^2 + 1 (0x8005)

Static Public Member Functions

static uint16_t compute (const uint8_t *buffer, uint16_t len, uint16_t crc=0)
 
static uint16_t compute (uint8_t byte, uint16_t crc=0)
 

Member Function Documentation

static uint16_t DUNE::Algorithms::CRC16::compute ( const uint8_t *  buffer,
uint16_t  len,
uint16_t  crc = 0 
)
inlinestatic

Compute the CRC-16-IBM of a given data buffer.

Parameters
bufferdata buffer.
lendata buffer length.
crcCRC-16-IBM value to update.
Returns
computed CRC-16-IBM.

References DUNE::Algorithms::c_crc16_ibm_table.

Referenced by DUNE::IMC::Packet::deserializePayload(), and DUNE::IMC::Packet::serialize().

static uint16_t DUNE::Algorithms::CRC16::compute ( uint8_t  byte,
uint16_t  crc = 0 
)
inlinestatic

Compute the CRC-16-IBM of a given byte.

Parameters
bytebyte.
crcCRC-16-IBM value to update.
Returns
computed CRC-16-IBM.

References DUNE::Algorithms::c_crc16_ibm_table.

Collaboration diagram for DUNE::Algorithms::CRC16:
Collaboration graph