| FastCRC Library | C++ Interface |
|
CFastCRC16::Calculate
static unsigned long Calculate( const unsigned char* pSrc, unsigned int nSrcLength );
static unsigned long Calculate( const char* pSrc );
static int Calculate( unsigned long* pCRC, const char* pFileName );
Parameters
pSrc
[in]
In the first case - pointer to the continuous memory block for which to calculate the checksum.
In the second case - pointer to the null-terminated string for which to calculate the checksum.
nSrcLength
[in] Length in bytes of the memory block.
pCRC
[out] Pointer to the variable that will receive the checksum.
pFileName
[in] Pointer to the null-terminated string specifying the name of the file for which to calculate the checksum.
Remarks
static unsigned long Calculate( const unsigned char* pSrc, unsigned int nSrcLength );
Calculates and returns the checksum for the memory block pointed by pSrc.
static unsigned long Calculate( const char* pSrc );
Calculates and returns the checksum for the null-terminated string pointed by pSrc.
static int Calculate( unsigned long* pCRC, const char* pFileName );
Calculates the checksum for the file pointed by pFileName. The checksum is retrieved in the variable pointed by pCRC.
Return value
Zero if calculation is successful, otherwise nonzero.
Example
|
Note.
In the above example mydata is a null-terminated string. Therefore, the call
CFastCRC16::Calculate( (const unsigned char*)mydata, strlen( mydata ) );
can be replaced by
CFastCRC16::Calculate( mydata );
CFastCRC16 Overview | Class Members | Useful Links | HashCalc
See Also SL_FCRC_ConvertToHex16
| Send Feedback to SlavaSoft Inc. | Tell a friend about FastCRC Library |