Loading...
Searching...
No Matches
gr::digital::crc Class Reference
GNU Radio C++ Signal Processing Blocks » Packet/Frame Operators

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.
| ~crc ()
uint64_t | compute (const uint8_t *data, std::size_t len)
| Computes a CRC.
uint64_t | compute (std::vector< uint8_t > const &data)
| Computes a CRC.

## 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_bits | CRC size in bits
  poly | CRC polynomial, in MSB-first notation
  initial_value | Initial register value
  final_xor | Final XOR value
  input_reflected | true if the input is LSB-first, false if not
  result_reflected | true 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

  data | the input data for the CRC calculation
  len | the 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

  data | the input data for the CRC calculation

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

- crc.h