Unit Crc2

Classes

CRCData - Base class for Resource loading CRCTaable class
TCRC16 -
TCRC32 -
TCRCCCITT -

Functions

GetCCITTForFile - //////////////////////////////////////////////////////////////////////////////
GetCRC16ForFile - //////////////////////////////////////////////////////////////////////////////} {//////////////////////////////////////////////////////////////////////////////
GetCRC32ForFile - Author: Jeff Ewing JSEwing@compuserve.

Types

TCRCType

Constants

Variables


Functions


Function GetCCITTForFile(Const Filename:String):Word;

//////////////////////////////////////////////////////////////////////////////

Function GetCRC16ForFile(Const Filename:String):Word;

//////////////////////////////////////////////////////////////////////////////} {//////////////////////////////////////////////////////////////////////////////

Function GetCRC32ForFile(Const Filename:String):LongInt;

Author: Jeff Ewing JSEwing@compuserve.com this unit depends on Value OverFlow to calculate Checksums. Be sure to disable overflow checking $Q- Otherwise you will have reported errors on iterations that overflow (alot of EM!)} { GIVING CREDIT WHERE ITS DUE.... This code was adapted from C++ Source listings contained in PRACTICAL ALGORITHMS FOR PROGRAMMERS (Addison Wesley ISBN: 0-201-63208-X) by Andrew Binstock & John Rex CRC-CCITT: Used with XMODEM-CRC protocol and IBM's early SDLC/HDLC protocols. CRC-16: Quick and Samll CRC-32: More accurate { ******* USE THESE CALLS********** These are the functions that you can use in YOUR code. The rest of this unit is really an exercise in resource handling on my part. I wanted to use this unit in main stream programs, but in the prev release all CRC data was stored in const arrays that hung around in memory. This unit overcomes that problem by loading the arrays at run time from resources... on demand.. and freeing them on destroy. ******* USE THESE CALLS

//////////////////////////////////////////////////////////////////////////////} {//////////////////////////////////////////////////////////////////////////////


Types


TCRCType=(crcCCITT,crc16,crc32);
this line adds the data file rcdata.res to your project, NOTE THAT IF this file is not found you will not run } {$R crcdata.res

Constants


Variables