QuickHash Library API


void SL_HASHCALL SL_CRC16C_CalculateHex( void* pDest, const void* pSrc, unsigned int nSrcLength, int bUpper );



    [out] Pointer to the text buffer that will receive the checksum.


    [in] Pointer to the continuous memory block for which to calculate the checksum.


    [in] Length in bytes of the memory block.


    [in] Uppercase flag. If bUpper is 0, the received checksum represents a lowercase string, otherwise it represents an uppercase string.


Calculates the checksum for the memory block pointed by pSrc. The checksum is retrieved as a null-terminated hexadecimal string in the text buffer pointed by pDest. The size of the text buffer pointed by pDest must be at least SLC_CRC16C_HEXDIGESTSIZE characters.


#include <string.h>
#include <QuickHash.h>

int main()
    char string[] = "Test String";
    char checksumhex[ SLC_CRC16C_HEXDIGESTSIZE ]; /*0 terminated*/

    /*****Calculate the checksum********************************/

    SL_CRC16C_CalculateHex( checksumhex, string, strlen( string ), 0 );

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

    return 0;



CRC16C API Overview   |   CRC16C API Functions   |   Useful Links   |   HashCalc


See Also    SL_CRC16C_Calculate, SL_CRC16C_CalculateStr, SL_CRC16C_CalculateStrHex



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