CryptoSys API Library Manual

CRC_File

CRC_File computes the CRC-32 checksum of a file.

VB6/VBA Syntax

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

nRet = CRC_File(strFileName, nOptions)

Parameters

strFileName
[in] String specifying the input file.
nOptions
[in] Long option flags: not used in this release. Specify zero.

C/C++ Syntax

long _stdcall CRC_File(const char *szFileName, long options);

Returns (VB6/C)

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

.NET Equivalent

Crc.File Method

COM/ASP Equivalent

crc32.FileHex
Public Function FileHex(ByVal strFileName As String) As String

See crc32.FileHex.

Remarks

The CRC-32 checksum may be a positive or negative number and is usually represented in hexadecimal. A return value of zero may indicate that the file could not be found. 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.

Example

    Dim nCRC As Long
    nCRC = CRC_File("hello.txt", 0)
    Debug.Print "CRC32('hello.txt')=" & Hex(nCRC)

See Also

CRC_Bytes CRC_String

[Contents] [Index]

[HOME]   [NEXT: CRC_String...]

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