Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!uw-entropy!dataio!pilchuck!seahcx!phred!jimo From: jimo@phred.UUCP (Jim Osborn) Newsgroups: comp.sys.mac.programmer Subject: Re: crc functions Message-ID: <3005@phred.UUCP> Date: 12 Mar 90 22:35:49 GMT References: <8548@netcom.UUCP> <1990Mar7.065639.11927@Neon.Stanford.EDU> <2981@murtoa.cs.mu.oz.au> Reply-To: jimo@phred.UUCP (Jim Osborn) Organization: <2981@murtoa.cs.mu.oz.au>o Lines: 21 Summary: Always init to -1 rob@murtoa.UUCP (Robert Wallen) writes: -kaufman@Neon.Stanford.EDU (Marc T. Kaufman) writes: --The way CRCs are meant to be used is: Initialize the CRC to all 1's, then --compute the CRC of the message. Send the message with the CRC appended to it. --On the receiving side, initialize the CRC to all 0's. Compute the CRC of the --entire message PLUS the message CRC. The result should be 0. If not, you - -Can someone confirm this? Or preferably deny it? I have never used a seed -value of all 1's (except one weirdo case where it wasnt CCITT CRC's being -used anyway) You must use the same initial value on both ends. Some people seem to like zero, but that leaves you vulnerable to computing a good CRC on an all-zero message. All-ones is a better choice, though I suppose you could use any non-zero value, as long as both ends agree to it. jimo -- pilchuck!jimo@phred Jim Osborn, Physio Control Corp 11811 Willows Rd, Redmond, WA, 98073 206-867-4704 direct to my desk