Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

CRC32 Class Reference

Computes the CRC-32 from a byte stream. More...

#include <crc32.hpp>

Inheritance diagram for CRC32:

Inheritance graph
[legend]
Collaboration diagram for CRC32:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CRC32 ()
 Default constructor.

wxUint32 getUint32Value () const
 Returns the CRC32 value.

wxString getValue (const bool hexInUpperCase=false) const
 Returns the CRC32 value in a string.

void reset ()
 Resets the CRC32 to initial value.

void update (const wxByte *buf, unsigned int len)
 Updates the CRC32 with specified array of bytes.


Protected Attributes

wxUint32 crc32
 The current CRC32 value.


Static Protected Attributes

const wxUint32 crc_table [256]
 Table used to compute the CRC32 value.


Detailed Description

Computes the CRC-32 from a byte stream.

This class is writen with the code found in cksfv and zlib code.

Using this class in very simple:<BR> Use the update method to provide to the class the bytes for computing the checksum.

The CRC-32 checksum value can be gotten by the getValue method which puts the CRC32 checksum value in a unsigned 32 bits integer.

The CRC32 checksum computing can be reseted by the reset method.

Definition at line 60 of file crc32.hpp.


Constructor & Destructor Documentation

CRC32::CRC32  ) 
 

Default constructor.

Definition at line 109 of file crc32.cpp.

References reset().


Member Function Documentation

wxUint32 CRC32::getUint32Value  )  const
 

Returns the CRC32 value.

Returns:
The current checksum value.

Definition at line 129 of file crc32.cpp.

References crc32.

Referenced by getValue().

wxString CRC32::getValue const bool  hexInUpperCase = false  )  const [virtual]
 

Returns the CRC32 value in a string.

Parameters:
hexInUpperCase If true the hexadecimal letters will be in uppercase.
Returns:
The current CRC32 value.

Implements Checksum.

Definition at line 143 of file crc32.cpp.

References getUint32Value(), and getValue().

Referenced by getValue().

void CRC32::reset  )  [virtual]
 

Resets the CRC32 to initial value.

Implements Checksum.

Definition at line 119 of file crc32.cpp.

References crc32.

Referenced by CRC32().

void CRC32::update const wxByte *  buf,
unsigned int  len
[virtual]
 

Updates the CRC32 with specified array of bytes.

Parameters:
buf The byte array to update the CRC32 with.
len The number of bytes to use for the update.

Implements Checksum.

Definition at line 159 of file crc32.cpp.

References crc32, crc_table, and update().

Referenced by update().


Member Data Documentation

wxUint32 CRC32::crc32 [protected]
 

The current CRC32 value.

Definition at line 67 of file crc32.hpp.

Referenced by getUint32Value(), reset(), and update().

const wxUint32 CRC32::crc_table [static, protected]
 

Table used to compute the CRC32 value.

Definition at line 48 of file crc32.cpp.

Referenced by update().


The documentation for this class was generated from the following files:
Generated on Sun May 30 13:38:03 2004 for wxChecksums by doxygen 1.3.7