home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.dcom.modems
- Path: sparky!uunet!cis.ohio-state.edu!mstar!mstar!bob
- From: bob@MorningStar.Com (Bob Sutterfield)
- Subject: Re: Efficient CRC routine?
- In-Reply-To: jroth@aegis.or.jp's message of 23 Nov 92 14: 48:38 GMT
- Message-ID: <BOB.92Nov23233408@volitans.MorningStar.Com>
- Sender: news@MorningStar.Com
- Nntp-Posting-Host: volitans.morningstar.com
- Organization: Morning Star Technologies
- References: <1394@minya.UUCP> <By5Hrs.GI3@wsrcc.com> <3246@aegis.or.jp>
- Date: Tue, 24 Nov 1992 04:34:12 GMT
- Lines: 19
-
- In article <3246@aegis.or.jp> jroth@aegis.or.jp (Joel Roth) writes:
- wolfgang@wsrcc.com (Wolfgang S. Rupprecht) writes:
- jc@minya.UUCP (John Chambers) writes:
- I've generally dismissed the use of CRCs in software, because
- the only algorithm I'd seen to generate (or check) them were
- so incredibly slow (shifting the bits out of each byte,
- plugging each into a polynomial, and all that) that the
- performance hit was totally out of the range of
- acceptability.
-
- Its only one or two lines of C depending on how you count it.
- Any good compiler will render it into 10 or less instructions.
-
- Some kind soul responded to an earlier query about this with code
- for using a lookup table instead of calculating the values with
- bit-shifting. Happy to post it if you like.
-
- See Appendix B of RFC-1331. The lookup table is fairly compact, and
- the algorithm is plenty fast. Of course, hardware is always faster...
-