Unit aCRC3216

*********************************************} { } { CRC32 calculation V1.0 } { Copyright (c) 1998 by Greg Bullock } { based heavily on the Unit aCRC32 } { by S.Kurinny & S.Kostinsky } { The main difference is that this one is } { compilable under Delph 1.0. } { } {

Classes

Functions

CalculateCRC32 - Calculates CRC value for a given buffer.
CRC32Calc - Calculates CRC for a given memory buffer.
CRC32Finish - Finishes calculation of CRC.
CRC32Start - Returns initialized CRC variable ($FFFFFFFF).
TestCRC - ----------------------------------------------------------------------} { Tests CRC algorythm.

Types

Constants

Variables


Functions


Function CalculateCRC32(VAR Buf;Count:word):LongInt;

Calculates CRC value for a given buffer. This function calls CRC32Start, CRC32Calc,CRC32 finish internally and returns calculated CRC value.

----------------------------------------------------------------------


function CRC32Calc(Var Buf;CRC:LongInt;BufSize:word):LongInt;

Calculates CRC for a given memory buffer. Buf - memory buffer. CRC - initial CRC value (result of previuos call to CRC32Calc or $FFFFFFFF). BufSize - buffer size. Returns new CRC value.

----------------------------------------------------------------------


function CRC32Finish(CRC:LongInt):LongInt;

Finishes calculation of CRC. If you don't need compartability with PKZIP's CRC algorythm you may not call this function.

----------------------------------------------------------------------


function CRC32Start:LongInt;

Returns initialized CRC variable ($FFFFFFFF). CRC variable should be initialized before calculating CRC.

----------------------------------------------------------------------


Function TestCRC:Boolean;

----------------------------------------------------------------------} { Tests CRC algorythm. Returns true if Ok. This function is for testing purposes only and you don't need to call it.

----------------------------------------------------------------------


Types


Constants


Variables