The Nebula Device 3: Util::Crc Class Reference

The Nebula Device 3

Util::Crc Class Reference

#include <crc.h>


Detailed Description

Compute CRC checksums over a range of memory.

(C) 2006 Radon Labs GmbH

Public Member Functions

 Crc ()
 constructor
void Begin ()
 begin computing a checksum
void Compute (unsigned char *buf, unsigned int numBytes)
 continue computing checksum
void End ()
 finish computing the checksum
unsigned int GetResult () const
 get result

Member Function Documentation

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,
unsigned int  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

get result

Get the result of the checksum computation. Must be executed after End().