home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c019 / 5.ddi / LZW.ZIP / CRC.PAS next >
Encoding:
Pascal/Delphi Source File  |  1993-05-19  |  1.5 KB  |  44 lines

  1. {$A+,B-,D-,E-,F-,I-,L-,N-,O-,R-,S-,V+}
  2. Unit Crc;
  3. { This unit provides a speed-optimized function to compute (or continue
  4.   computation of) a Cyclic Redundency Check (CRC).  This routines is
  5.   contributed to the public domain (with the limitations noted by the
  6.   original authors in the TASM sources).
  7.  
  8.   The function takes three parameters:
  9.  
  10.   InitCRC - The initial CRC value.  This may be the recommended
  11.   initialization value if this is the first or only block to be checked,
  12.   or this may be a previously computed CRC value if this is a continuation.
  13.  
  14.   InBuf - An untyped parameter specifying the beginning of the memory area
  15.   to be checked.
  16.  
  17.   InLen - A word indicating the length of the memory area to be checked.  If
  18.   InLen is zero, the function returns the value of InitCRC.
  19.  
  20.   The function result is the updated CRC.  The input buffer is scanned under
  21.   the limitations of the 8086 segmented architecture, so the result will be
  22.   in error if InLen > 64k - Offset(InBuf).
  23.  
  24.   These conversions were done on 10-29-89 by:
  25.  
  26.   Edwin T. Floyd [76067,747]
  27.   #9 Adams Park Court
  28.   Columbus, GA 31909
  29.   (404) 576-3305 (work)
  30.   (404) 322-0076 (home)
  31. }
  32. Interface
  33.  
  34.  
  35. Function UpdateCRCArc(InitCRC : Word; Var InBuf; InLen : Word) : Word;
  36. { This function computes the CRC used by SEA's ARC utility.  Initialize
  37.   with zero. }
  38.  
  39.  
  40. Implementation
  41. Function UpdateCRCArc(InitCRC : Word; Var InBuf; InLen : Word) : Word;
  42. External;
  43. {$L CRCARC.OBJ }
  44. End.