LibDS
Qt-based library for controlling FRC robots
|
Computes the CRC32 data checksum of a data stream. More...
#include <CRC32.h>
Public Member Functions | |
CRC32 () | |
long | value () |
void | update (QByteArray buf) |
void | update (QByteArray buf, int off, int len) |
Private Member Functions | |
void | make_crc_table () |
Private Attributes | |
int | m_crc |
int * | m_crc_table |
Computes the CRC32 data checksum of a data stream.
Can be used to get the CRC32 over a stream if used with checked input/output streams.
|
explicit |
Generates the CRC table during initialization
References make_crc_table().
|
private |
Generates a table for fast CRC
Referenced by CRC32().
void CRC32::update | ( | QByteArray | buf | ) |
Overloaded function. Adds the byte array to the data checksum.
buf | the data buffer |
Referenced by FRC_2014::getRobotPacket().
void CRC32::update | ( | QByteArray | buf, |
int | off, | ||
int | len | ||
) |
Adds the byte array to the data checksum.
buf | the data buffer |
off | the offset in the buffer where the data starts |
len | the length of the data |
long CRC32::value | ( | ) |
Returns the CRC32 data checksum computed so far.
Referenced by FRC_2014::getRobotPacket().