CryptoSys API Library Manual

CRC_String

Computes the CRC-32 checksum of an ANSI string.

VBA/VB6 Syntax

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

nRet = CRC_String(strData, nOptions)

C/C++ Syntax

int32_t __stdcall CRC_String(const char *szInput, long nOptions);

Parameters

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

Returns (VBA/C)

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.

C++ (STL) Equivalent

static int crsysapi::Crc::String (const std::string &s)

Remarks

The CRC-32 checksum is a 32-bit integer value. 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]

[PREV: CRC_File...]   [Contents]   [Index]   
   [NEXT: DES_B64Mode...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.