Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!usc!ucsd!ucbvax!decwrl!decvax!ima!cfisun!lakart!dg From: dg@lakart.UUCP (David Goodenough) Newsgroups: comp.sources.wanted Subject: How to turn a CRC table back into the old shift/xor method Message-ID: <669@lakart.UUCP> Date: 25 Aug 89 02:24:25 GMT Reply-To: dg@lakart.UUCP (David Goodenough) Organization: Lakart Corporation - The ultimate in broadcast automation Lines: 19 The "hip" method for doing CRC evaluation nowadays is to use one of these table driven beasties. However, in a 32 bit environment, the table requires 1K. Given that I am working in a situation where memory is a premium item, I would like to sacrifice speed for size. The stock way of doing CRC is: xorflag = most_significant_bit_of_crc_value; crc_value += crc_value + new_bit; if (xorflag) crc_value ^= some_constant; for each bit in the data. Can I assume that the "some_constant" is the first non-zero value in the array? Any other "gotcha's" I should watch for? Thanks in advance, -- dg@lakart.UUCP - David Goodenough +---+ IHS | +-+-+ ....... !harvard!xait!lakart!dg +-+-+ | AKA: dg%lakart.uucp@xait.xerox.com +---+