[comp.sources.wanted] How to turn a CRC table back into the old shift/xor method

dg@lakart.UUCP (David Goodenough) (08/25/89)

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			  +---+