Pre-Defined CRC Samples

| Home | Libraries | People | FAQ | More

## Pre-Defined CRC Samples

    namespace boost
    {
        typedef crc_optimal<16, 0x8005, 0, 0, true, true>
          crc_16_type;

        typedef crc_optimal<16, 0x1021, 0xFFFF, 0, false, false>
          crc_ccitt_false_t, crc_ccitt_type;
        typedef crc_optimal<16, 0x1021, 0, 0, true, true>  crc_ccitt_true_t;

        typedef crc_optimal<16, 0x8408, 0, 0, true, true>    crc_xmodem_type;
        typedef crc_optimal<16, 0x1021, 0, 0, false, false>  crc_xmodem_t;

        typedef crc_optimal<32, 0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF, true, true>
          crc_32_type;
    }

Several sample CRC types are given, representing common CRC algorithms. The samples have now been checked against the Catalogue of parametrised CRC algorithms, leading to some new type-aliases corresponding to the corrected profiles. (Older, incorrect profiles keep their name for backwards compatibility.) However, this library is primarily concerned with CRC implementation, and not with determining "good" sets of CRC parameters.

Table 9.4. Common CRCs

Computer Type | Standard(s)
--- | ---
`crc_16_type` | BISYNCH, ARC, LHA, ZOO
`crc_ccitt_false_t` | Commonly misidentified as the standard by CCITT
`crc_ccitt_type` | `crc_ccitt_false_t` (I made the same mistake.)
`crc_ccitt_true_t` | Designated by CCITT (Comité Consultatif International Télégraphique et Téléphonique), KERMIT
`crc_xmodem_type` | A mistake I didn't catch in defining `crc_xmodem_t`.
`crc_xmodem_t` | XMODEM, ZMODEM, ACORN
`crc_32_type` | ADCCP, PKZip, libPNG, AUTODIN II, Ethernet, FDDI