|
FastCRC Library |
API |
|
SL_FCRC16C_CalculateStr
unsigned long SL_FCRCCALL SL_FCRC16C_CalculateStr(
const char* pSrc );
Return value
The checksum.
Parameters
pSrc
[in] Pointer to the
null-terminated string for which to calculate the checksum.
Remarks
Calculates the checksum for the
null-terminated string
pointed by pSrc.
Note. The call SL_FCRC16C_CalculateStr( pSrc );
is equivalent to the call
SL_FCRC16C_Calculate(
pSrc, strlen( pSrc ) );
Example
#include <FastCRC.h>
int main()
{
char string[] = "Test String";
unsigned long checksum;
char checksumhex[ SLC_FCRC_MAXHEXSIZE ]; /*0 terminated*/
/*****Calculate the checksum********************************/
checksum = SL_FCRC16C_CalculateStr( string );
/*****Get the hexadecimal representation of the checksum****/
SL_FCRC_ConvertToHex16( checksumhex, checksum, 0 );
/*****Use the checksum**************************************/
/*...*/
return 0;
}
|
|
CRC16C API Overview
| CRC16C API_Functions
|
Useful Links | HashCalc
See Also
SL_FCRC16C_Calculate,
SL_FCRC16C_CalculateFile,
SL_FCRC_ConvertToHex16
|