Class to allow calculation across multiple buffers.
More...
#include <CRC32_RK.h>
|
|
| State () |
| | Construct the State object for holding the CRC state.
|
| |
|
virtual | ~State () |
| | Destructor. This object does not have any externally allocated data and the destructor is trivial.
|
| |
| uint32_t | calculate (const unsigned char *buf, size_t len) |
| | Calculate the CRC32 for a buffer of data.
|
| |
|
void | clear () |
| | Clear the state to be the same as when a new object is created.
|
| |
| | State (const State &other) |
| | Copies the state from another object during construction.
|
| |
| State & | operator= (const State &other) |
| | Copy the state from another object into this object.
|
| |
| bool | operator== (const State &other) const |
| | Returns true if this object and other have the same CRC state.
|
| |
|
|
uint32_t | crc = 0xffffffff |
| | The current CRC state. This is not the same as the result from calculate!
|
| |
Class to allow calculation across multiple buffers.
Call the calculate() method to add a buffer. Returns the CRC to that point.
See also the static calculate() method in the CRC32_RK class that does not require creating a State object.
◆ State()
| CRC32_RK::State::State |
( |
const State & | other | ) |
|
|
inline |
Copies the state from another object during construction.
- Parameters
-
◆ calculate()
| uint32_t CRC32_RK::State::calculate |
( |
const unsigned char * | buf, |
|
|
size_t | len ) |
Calculate the CRC32 for a buffer of data.
- Parameters
-
| buf | Pointer to a buffer to calculate the CRC for. Cannot be null. |
| len | The length of the buffer in bytes |
- Returns
- uint32_t The CRC32 of the data thus far
The State object contains the current CRC32 being calculated. You can call calculate multiple times on a single State instance to calculate the CRC for the entire data in chunks.
◆ operator=()
| State & CRC32_RK::State::operator= |
( |
const State & | other | ) |
|
|
inline |
Copy the state from another object into this object.
- Parameters
-
- Returns
- State&
◆ operator==()
| bool CRC32_RK::State::operator== |
( |
const State & | other | ) |
const |
|
inline |
Returns true if this object and other have the same CRC state.
- Parameters
-
- Returns
- true
-
false
The documentation for this class was generated from the following files: