|
Nebula
|
#include <crc.h>
Compute CRC checksums over a range of memory.
Public Member Functions | |
| Crc () | |
| constructor | |
| void | Begin () |
| begin computing a checksum | |
| template<typename sizetype> | |
| void | Compute (unsigned char *buf, sizetype numBytes) |
| continue computing checksum | |
| void | End () |
| finish computing the checksum | |
| unsigned int | GetResult () const |
| get result | |
Private Attributes | |
| bool | inBegin |
| bool | resultValid |
| unsigned int | checksum |
Static Private Attributes | |
| static const unsigned int | Key = 0x04c11db7 |
| static const unsigned int | NumByteValues = 256 |
| static unsigned int | Table [NumByteValues] = { 0 } |
| static bool | TableInitialized = false |
| Util::Crc::Crc | ( | ) |
constructor
| void Util::Crc::Begin | ( | ) |
begin computing a checksum
Begin computing a CRC checksum over several chunks of data.
This can be done in multiple runs, which is the only useful way to compute checksum for large files.
| void Util::Crc::Compute | ( | unsigned char * | buf, |
| sizetype | numBytes ) |
continue computing checksum
Do one run of checksum computation for a chunk of data.
Must be executed inside Begin()/End().
| void Util::Crc::End | ( | ) |
finish computing the checksum
End checksum computation.
This validates the result, so that it can be accessed with GetResult().
| unsigned int Util::Crc::GetResult | ( | ) | const |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
private |
|
staticprivate |
|
staticprivate |