home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16770 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.1 KB  |  38 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!agate!rsoft!mindlink!a7657
  3. From: a7657@mindlink.bc.ca (Stephen H. Kawamoto)
  4. Subject: CRC-32 C code needed
  5. Organization: MIND LINK! - British Columbia, Canada
  6. Date: Thu, 19 Nov 1992 04:40:37 GMT
  7. Message-ID: <17583@mindlink.bc.ca>
  8. Sender: news@deep.rsoft.bc.ca (Usenet)
  9. Lines: 27
  10.  
  11. I'm trying to make my CRC-32 C program work but
  12.  
  13.                   for ( c = i << 24, j = 8; j > 0; --j)
  14.                             ========
  15.                              this loses bits
  16.  
  17.         and when the table is built,
  18.  
  19.  
  20.                         crc = (crc << 8 ) ^ crc_table[(crc >> 24) ^ *p];
  21.                                                        =========
  22.                                                        this loses significent
  23.                                                        bits
  24.  
  25.  
  26.  
  27.  
  28.  
  29.                        is there a better way to do this?
  30.  
  31. --
  32. Stephen Kawamoto <a7657@mindlink.bc.ca>
  33.     "It is the very mind itself
  34.      That leads the mind astray;
  35.      Of the mind,
  36.      Do not be mindless."
  37.      (an old Japanese folk song)
  38.