|
FastCRC Library |
C++ Interface |
|
CFastCRC16C::Final
unsigned long Final();
Return value
The checksum.
Remarks
Call this member function to retrieve the checksum from the CFastCRC16C
object.
After the Final method is performed, the CFastCRC16C
object is initialized for new calculations, as it would be constructed
again.
Example
#include <fstream>
#include <FastCRC.h>
using namespace std;
using namespace FastCRC;
const unsigned int BUFF_SIZE = 1024;
int main()
{
fstream file( "c:\\test.txt", ios::in | ios::binary );
if( !file )
return 1;
unsigned char buff[ BUFF_SIZE ];
//Instantiate a CFastCRC16C object
CFastCRC16C crcobj;
//Calculate the checksum by calling Update for each block of the file
while( !file.eof() )
{
file.read( ( char* )buff, BUFF_SIZE );
crcobj.Update( buff, file.gcount() );
}
//Do final changes and get the checksum
unsigned long checksum = crcobj.Final();
//Use the checksum
//...
file.close();
return 0;
}
|
|
CFastCRC16C Overview
| Class Members
|
Useful Links | HashCalc
See Also
CFastCRC16C::Update,
SL_FCRC_ConvertToHex16
|