Computes the CRC-32 checksum of an ANSI string.
Public Declare Function CRC_String Lib "diCryptoSys.dll"
(ByVal strInput As String, ByVal nOptions As Long) As Long
nRet = CRC_String(strData, nOptions)
String ANSI string input.Long option flags: not used in this release. Specify zero.
long _stdcall CRC_String(const char *szInput, long options);
Long: The return value is the value of the CRC-32 checksum.
Crc.Data Method (String)
crc32.StringHex
Public Function StringHex(ByVal strData As String) As String
See crc32.StringHex.
The CRC-32 checksum may be a positive or negative number and is usually represented in hexadecimal.
The CRC-32 algorithm uses the polynomial 0x04C11DB7 and is the one specified in ISO 3309 and ITU-T V.42 and used by WinZip.
Dim strData As String
Dim nCRC As Long
strData = "123456789"
nCRC = CRC_String(strData, 0)
Debug.Print "CRC32(" & strData & ")=" & Hex(nCRC)
should output
CRC32(123456789)=CBF43926