Boost logo

Boost :

From: Nathan Myers (ncm-yahoospam_at_[hidden])
Date: 2002-03-18 22:42:37


On Mon, Mar 18, 2002 at 08:20:37AM -0500, nbecker_at_[hidden] wrote:
> CRC calculation should be generic. After a brief look at this code I
> think the polynomial is hard-wired.
>
> Ideally, the CRC calculation should be a simple function that is
> generic both in the polynomial and in the size.

In an ideal world, all programs would run instantaneously. All practical
CRC codes (including those already in Boost) are table-driven, if not
actually rendered in real, physical wires, and the table is populated at
startup, at compile-time, or before. That's OK, because there is very
little need ever to change polynomials; in any given application only one
is used. They have names: CRC-16, CRC-32, CRC-CCITT.

The one I posted uses one of only two 64-bit CRC polynomials I found in
use anywhere, after quite a long web search. The genetics people use one
they got out of the Numerical Recipes book, but which has no particularly
desirable properties. This one has some serious engineering behind it.

I recommend reading the paper at the URL in the header file I posted
(again,
  ftp://ftp.rocksoft.com/papers/crc_v3.txt
). It really is very enlightening.

Nathan Myers
ncm at cantrip dot org


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk