semf
|
Interface for implementing cyclic redundancy check (CRC). More...
#include <crc.h>
Public Member Functions | |
virtual | ~Crc ()=default |
virtual void | reset ()=0 |
Resets internal values to their initial values. More... | |
virtual const uint8_t * | accumulate (const uint8_t data[], size_t size)=0 |
Computes the CRC of the input data using a combination of the previous CRC value and the new one. More... | |
virtual const uint8_t * | calculate (const uint8_t data[], size_t size)=0 |
Calculates the CRC of the input data . More... | |
virtual bool | isEqual (const uint8_t data[])=0 |
Checks if previously calculated CRC is equal to the input value. More... | |
virtual size_t | bitSize () const =0 |
Returns the size of the CRC in bits. More... | |
virtual size_t | byteSize () const =0 |
Returns the size of the CRC in bytes. More... | |
|
virtualdefault |
|
pure virtual |
Computes the CRC of the input data using a combination of the previous CRC value and the new one.
data | Data over which a CRC value will be computed. |
size | Size of the input data. |
Implemented in semf::CrcSoftware< T, DEFAULT_POLYNOMIAL, DEFAULT_INITVALUE, DEFAULT_FINALXOR >.
|
pure virtual |
Returns the size of the CRC in bits.
Implemented in semf::CrcSoftware< T, DEFAULT_POLYNOMIAL, DEFAULT_INITVALUE, DEFAULT_FINALXOR >.
|
pure virtual |
Returns the size of the CRC in bytes.
Implemented in semf::CrcSoftware< T, DEFAULT_POLYNOMIAL, DEFAULT_INITVALUE, DEFAULT_FINALXOR >.
|
pure virtual |
Calculates the CRC of the input data
.
accumulate()
function. data | Data over which a CRC value will be computed. |
size | Size of the input data. |
Implemented in semf::CrcSoftware< T, DEFAULT_POLYNOMIAL, DEFAULT_INITVALUE, DEFAULT_FINALXOR >.
|
pure virtual |
Checks if previously calculated CRC is equal to the input value.
data | CRC value to compare with calculated CRC value. |
true
for CRCs are equal, otherwise false
. Implemented in semf::CrcSoftware< T, DEFAULT_POLYNOMIAL, DEFAULT_INITVALUE, DEFAULT_FINALXOR >.
|
pure virtual |
Resets internal values to their initial values.
Implemented in semf::CrcSoftware< T, DEFAULT_POLYNOMIAL, DEFAULT_INITVALUE, DEFAULT_FINALXOR >.