XbZ_CRC32()
Previous  Top  Next

XbZ_CRC32() - Calculate the CRC of a string.

Syntax

XbZ_CRC32(<@cData>) --> cCRC  

Parameters

<@cData>  
<@cData> contains a Text string for which the CRC should be calculated, and must be passed by reference, even though <@cData> is not modified by this function.  

Returns

This function returns the 32-bit CRC for the supplied <@cData> as a 4-character long string.  

Description

This function returns the 32-bit CRC (Cyclic Redundancy Check) for <@cData>. Since the value is an unsigned long, it cannot be returned as numeric from a C/C++ function (the C-API and the DLL API functions only allow for signed long numbers). Therefore, the value is returned as its U2Bin() equivalent, which is a 4-character string. This function is the XBZLCRC32() function in the file "CRC32.obj" file and is simply mapped to XbZ_CRC32() with a #pragma directive!  
 
NOTE: To convert the CRC string to a Number, so it can be displayed, use: Bin2U(cCRC).  

Example

QOut(XbZ_Num2Hex(Bin2U(XbZ_CRC32(@cData)), 8)) --> "0B4D7F18"