Contents 

SlavaSoft FastCRC Library Online Help

Prev Page Next Page
FastCRC Library API

SL_FCRC16_CalculateStr

unsigned long SL_FCRCCALL SL_FCRC16_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_FCRC16_CalculateStr( pSrc );

            is equivalent to the call SL_FCRC16_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_FCRC16_CalculateStr( string );

    /*****Get the hexadecimal representation of the checksum****/

    SL_FCRC_ConvertToHex16( checksumhex, checksum, 0 );

    /*****Use the checksum**************************************/
    /*...*/

    return 0;
}

 

 

CRC16 API Overview   |   CRC16 API_Functions   |   Useful Links   |   HashCalc

 

See Also    SL_FCRC16_Calculate, SL_FCRC16_CalculateFile, SL_FCRC_ConvertToHex16


 

 

Send Feedback to SlavaSoft Inc. Tell a friend about FastCRC Library