CryptoSys API Library Manual

CRC_String

Computes the CRC-32 checksum of an ANSI string.

VB6/VBA Syntax

Public Declare Function CRC_String Lib "diCryptoSys.dll" (ByVal strInput As String, ByVal nOptions As Long) As Long

nRet = CRC_String(strData, nOptions)

Parameters

strData
[in] String ANSI string input.
nOptions
[in] Long option flags: not used in this release. Specify zero.

C/C++ Syntax

long _stdcall CRC_String(const char *szInput, long options);

Returns (VB6/C)

Long: The return value is the value of the CRC-32 checksum.

.NET Equivalent

Crc.Data Method (String)

COM/ASP Equivalent

crc32.StringHex
Public Function StringHex(ByVal strData As String) As String

See crc32.StringHex.

Remarks

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.

Examples

    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

See Also

CRC_Bytes CRC_File

[Contents] [Index]

[HOME]   [NEXT: DES_B64Mode...]

Copyright © 2001-11 D.I. Management Services Pty Ltd. All rights reserved.