![]() |
semf
|
Template class for CRC generation in software. More...
#include <crcsoftware.h>
Public Member Functions | |
CrcSoftware (T polynomial=DEFAULT_POLYNOMIAL, T initValue=DEFAULT_INITVALUE, T finalXor=DEFAULT_FINALXOR) | |
Constructor. More... | |
virtual | ~CrcSoftware ()=default |
void | reset () |
Resets internal values to their initial values. More... | |
const uint8_t * | accumulate (const uint8_t data[], size_t dataSize) override |
Computes the CRC of the input data using a combination of the previous CRC value and the new one. More... | |
const uint8_t * | calculate (const uint8_t data[], size_t dataSize) override |
Calculates the CRC of the input data . More... | |
bool | isEqual (const uint8_t data[]) override |
Checks if previously calculated CRC is equal to the input value. More... | |
size_t | bitSize () const override |
Returns the size of the CRC in bits. More... | |
size_t | byteSize () const override |
Returns the size of the CRC in bytes. More... | |
![]() | |
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... | |
Template class for CRC generation in software.
T | CRC data type |
DEFAULT_POLYNOMIAL | CRC default polynomial. |
DEFAULT_INITVALUE | CRC default init value. |
DEFAULT_FINALXOR | CRC default final xor. |
Definition at line 29 of file crcsoftware.h.
|
explicit |
Constructor.
polynomial | Uses this polynomial instead of the default polynomial. |
initValue | Uses this initValue instead of the default initValue. |
finalXor | Uses this final xor value instead of the default final xor value. |
Definition at line 66 of file crcsoftware.h.
|
virtualdefault |
|
overridevirtual |
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. |
Implements semf::app::Crc.
Definition at line 82 of file crcsoftware.h.
|
overridevirtual |
Returns the size of the CRC in bits.
Implements semf::app::Crc.
Definition at line 123 of file crcsoftware.h.
|
overridevirtual |
Returns the size of the CRC in bytes.
Implements semf::app::Crc.
Definition at line 129 of file crcsoftware.h.
|
overridevirtual |
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. |
Implements semf::app::Crc.
Definition at line 101 of file crcsoftware.h.
|
overridevirtual |
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
. Implements semf::app::Crc.
Definition at line 110 of file crcsoftware.h.
|
virtual |
Resets internal values to their initial values.
Implements semf::app::Crc.
Definition at line 75 of file crcsoftware.h.