Xceed Zip Compression Library Documentation
CalculateCrc method
Xceed Compression control reference > Xceed Compression control methods > CalculateCrc method

Description

The CalculateCrc method is provided as a convenience feature for developers that need to calculate a CRC on data without compressing it at all. The checksum provided by the CalculateCrc method is the industry standard CRC-32 checksum used by the Zip format and the Zmodem communications protocol, for example.

This method allows you to calculate the CRC for an entire block of data in one call, or you can call it multiple times.

Declaration (ActiveX)  
Method CalculateCrc(vaData As Variant, lPreviousCrc As Long) As Long
Declaration (DLL API)  
long XcCalculateCrc( HXCEEDCMP hComp, const BYTE* pcData, DWORD dwDataSize, long lPreviousCrc )

Parameters

Parameter Description
vaData  The data to calculate the CRC-32 for. This is a variant of type string or byte array.
lPreviousCrc  When you call the CalculateCrc method and require the CRC-32 for an entire block of data, set this parameter to 0. This parameter is mainly used when you are making multiple calls to the CalculateCRC method for a very large block of data, or for streaming data. The return value of the previous CalculateCrc method call should be provided in this parameter so that the CRC-32 can continue to be updated for the rest of the data.

Return values

The return value contains the CRC-32 calculated for the data.

Applicable properties

None.