home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / DLLIB.ZIP / CRC.DOC < prev    next >
Encoding:
Text File  |  1986-09-25  |  1.3 KB  |  39 lines

  1.  
  2.  
  3.        NAME
  4.                crc functions -- crc misc. functions
  5.  
  6.        SYNOPSIS
  7.                short crc_clear();       clear crc value
  8.                crc_update(crc, chr);    update crc value
  9.                short crc_finish(crc);   finish crc calculation
  10.  
  11.        DESCRIPTION
  12.        These functions are used in crc calculations mainly for
  13.        modem programs.  crc_clear is used to clear the crc value.
  14.        However, if speed is a concern, just zero the crc value since
  15.        crc_clear does nothing other than return a zero.
  16.        crc_update is called once for each character to add to the crc.
  17.        It receives the running crc and the character to be added.
  18.        crc_finish actually calls crc_update twice with a value of
  19.        0 in order to flush the 16 bit calculation and return the final crc
  20.        calculation.
  21.  
  22.        EXAMPLE
  23.               short crc;
  24.               crc = crc_clear();
  25.               /* for each character processed: */
  26.               crc = crc_update(crc, next_chr);
  27.               /* finally, */
  28.               crc = crc_finish;
  29.  
  30.  
  31.  
  32.        NOTE:
  33.        These functions are from a public domain source, author
  34.        unknown,  They are not copyrighted.
  35.  
  36.  
  37.  
  38.        This function is found in SMDLx.LIB for the Datalight Compiler.
  39.