GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem

Calculates a CRC. More...

#include <gnuradio/digital/crc.h>

Public Member Functions

 crc (unsigned num_bits, uint64_t poly, uint64_t initial_value, uint64_t final_xor, bool input_reflected, bool result_reflected)
 Construct a CRC calculator instance. More...
 
 ~crc ()
 
uint64_t compute (const uint8_t *data, std::size_t len)
 Computes a CRC. More...
 
uint64_t compute (std::vector< uint8_t > const &data)
 Computes a CRC. More...
 

Detailed Description

Calculates a CRC.

This class calculates a CRC with configurable parameters. A table-driven byte-by-byte approach is used in the CRC computation.

Constructor & Destructor Documentation

◆ crc()

gr::digital::crc::crc ( unsigned  num_bits,
uint64_t  poly,
uint64_t  initial_value,
uint64_t  final_xor,
bool  input_reflected,
bool  result_reflected 
)

Construct a CRC calculator instance.

Parameters
num_bitsCRC size in bits
polyCRC polynomial, in MSB-first notation
initial_valueInitial register value
final_xorFinal XOR value
input_reflectedtrue if the input is LSB-first, false if not
result_reflectedtrue if the output is LSB-first, false if not

◆ ~crc()

gr::digital::crc::~crc ( )

Member Function Documentation

◆ compute() [1/2]

uint64_t gr::digital::crc::compute ( const uint8_t *  data,
std::size_t  len 
)

Computes a CRC.

Parameters
datathe input data for the CRC calculation
lenthe length in bytes of the data

◆ compute() [2/2]

uint64_t gr::digital::crc::compute ( std::vector< uint8_t > const &  data)
inline

Computes a CRC.

Parameters
datathe input data for the CRC calculation

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