FastCRC Library API

SL_FCRC32_CalculateStr

unsigned long SL_FCRCCALL SL_FCRC32_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_FCRC32_CalculateStr( pSrc );

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

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

    SL_FCRC_ConvertToHex32( checksumhex, checksum, 0 );

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

    return 0;
}

 

 

CRC32 API Overview   |   CRC32 API_Functions   |   Useful Links   |   HashCalc

 

See Also    SL_FCRC32_Calculate, SL_FCRC32_CalculateFile, SL_FCRC_ConvertToHex32


 

 

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