void FinalHex( char* pDest, bool
bUpper = false );
[out] Pointer to the text
buffer that will receive the checksum.
[in] Uppercase flag.
bUpper is false, the received checksum represents a lowercase string,
otherwise it represents an uppercase string.
Call this member function to retrieve the checksum from the CCRC32
object. The checksum is retrieved as a null-terminated hexadecimal string in the
pointed by pDest. The size of the text buffer pointed by pDest
must be at least CCRC32::HEXDIGESTSIZE characters.
After the FinalHex method is performed, the CCRC32
object is initialized for new calculations, as it would be constructed
using namespace std;
using namespace QuickHash;
const unsigned int BUFF_SIZE = 1024;
fstream file( "c:\\test.txt", ios::in | ios::binary );
if( !file )
unsigned char buff[ BUFF_SIZE ];
char checksumhex[ CCRC32::HEXDIGESTSIZE ]; //0 terminated
//Instantiate a CCRC32 object
//Calculate the checksum incrementally block by block using Update
while( !file.eof() )
file.read( ( char* )buff, BUFF_SIZE );
hash.Update( buff, file.gcount() );
//Do final changes and get the checksum in hex format
hash.FinalHex( checksumhex );
//Use the checksum
| Class Members
Useful Links | HashCalc
See Also CCRC32::Final, CCRC32::Update