Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!texbell!texsun!newstop!sun!imagen!qmsseq!pipkins From: pipkins@qmsseq.imagen.com (Jeff Pipkins) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: CCITT CRC-16 Keywords: CRC, fast Message-ID: <144@qmsseq.imagen.com> Date: 13 Jul 90 19:27:08 GMT References: <269bd6d3-120comp.sys.ibm.pc.programmer@vpnet.chi.il.us> <1990Jul13.013921.1320@cec1.wustl.edu> Reply-To: pipkins@imagen.com (Jeff Pipkins) Organization: QMS Inc., Mobile, Alabama Lines: 24 In article <1990Jul13.013921.1320@cec1.wustl.edu> jma7759@cec1.wustl.edu (James Michael Anderson) writes: >In article <269bd6d3-120comp.sys.ibm.pc.programmer@vpnet.chi.il.us> cgordon@vpnet.chi.il.us (Gordon Hlavenka) writes: >> >>I need to generate the CCITT CRC16 for an array of bytes. I know there's a >>sexy little algorithm which does it in a dozen lines or so, without lookup >>tables. It uses SHL's and XOR's... > > Hey! I'm looking for the same; however, I have a need for the FASTEST >version possible (lookup tables are OK). Anybody got any suggestions >for this one? I belive that there exists (once again) an algorithm that >uses a table of "pre-shifted" values... There is a book called "C Programmer's Guide to NetBIOS" by David Schwaderer (sp?). It has the best treatment of CRC's for software types that I have seen anywhere. It explains several different kinds of CRC's, including CRC-16, CRC-32, and others. It has both bit-at-a-time algorithms (less space, more time), and table lookup algorithms (more space, less time). Even if you couldn't care less about NetBIOS, if you are at all interested in CRC's, this book is a must. --Jeff Pipkins pipkins@imagen.com Disclaimer: "I've already told you more than I know!"