[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Function            CRC32tupdate - update a CRC-32 value via tables

  Syntax              unsigned long CRC32tupdate(char c,
                                                 unsigned long crc);

  Prototype in        comm.h

  Remarks             updates a CRC-32 value based on the polynomial
                      X32 + X26 + X23 + X22 + X16 + X12 + X11 +
                      X10 + X8 + X7 + X5 + X4 + X2 + X1 + X0
                      given c and the original crc value. This CRC-32
                      value is commonly used by the transmission protocol
                      Zmodem.

                      This function is table driven.

                      Before the first call to this function, be sure to
                      initialize crc to 0xFFFFFFFF.

  Return value        returns an updated CRC-32 value.

  Note                This function is designed for data communications
                      and returns the crc bytes in LOW to HIGH order, NOT
                      byte reversed! To turn the value into a 'normal'
                      unsigned long, you must reverse the bytes! Here is
                      a code fragment to reverse the bytes:

                           int i;
                           unsigned long normal;

                           /* get crc value */

                           for (normal=0lu, i=0; i<4; i++) {
                                normal << 8;
                                normal |= (crc & 0x000000FF)
                                crc >>= 8;
                           }

                      ZIP files, designed by Phil Katz, use a CRC-32,
                      although I believe the CRC-32 used is 'normalized'
                      and not byte reversed as returned by this function.

  See also            Checksum_block(), CRC16_block(), CRC16update(),
                      CRC16tupdate()


See Also: Checksum_Block() CRC16_block() CRC16tupdate() CRC16update()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson