LibDS
Qt-based library for controlling FRC robots
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CRC32 Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

CRC32::CRC32 ( )
explicit

Generates the CRC table during initialization

References make_crc_table().

Member Function Documentation

void CRC32::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.

Parameters
bufthe data buffer

Referenced by FRC_2014::getRobotPacket().

void CRC32::update ( QByteArray  buf,
int  off,
int  len 
)

Adds the byte array to the data checksum.

Parameters
bufthe data buffer
offthe offset in the buffer where the data starts
lenthe length of the data
long CRC32::value ( )

Returns the CRC32 data checksum computed so far.

Referenced by FRC_2014::getRobotPacket().


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