#include <crc.h>
Inheritance diagram for CRC:


Usage flow: CRC() // construct CRC object add() // call as many times as necessary to process data final() // finalize computation sum() // obtain 32-bit CRC value Recommendations for strict FIPS 140-1 compliance: CRC-32 is not a FIPS approved algorithm, so the CRC class should *NOT* be used for cryptographic operations.
Sample code illustrating the use of this class appears in the Cookbook section Using the Message Digest Functions.
as specified in the following standards: Autodin II, IEEE 802.3 (Ethernet), ISO/IEC-3309 (HDLC), RFC 1662 (PPP), and RFC 1952 (GZIP).
Public Member Functions | |
| CRC (int v=1) | |
| Constructor. | |
| ~CRC () | |
| Destructor. Calls clear(). | |
| void | add (int count, const char *s) |
| Update CRC with contents of buffer. | |
| void | add (char c) |
| Update CRC with a single byte. | |
| void | final (void) |
| Perform final masking operation. | |
| unsigned int | sum () const |
| Get final CRC value. | |
| int | length () const |
| Get size of CRC value in bytes. | |
| template<class T> | |
| T | to () const |
| Convert 32-bit CRC value to type T. | |
| str | tostr () const |
| Convert 32-bit CRC value to a str. | |
| void | clear (void) |
| Clear CRC object. | |
| void | reset (void) |
| Reset CRC object. Alias for clear(). | |
| CRC | ( | int | v = 1 |
) | [inline] |
Constructor.
| v | unused, but facilitates the use of templates. |
| void add | ( | char | c | ) | [inline] |
Update CRC with a single byte.
| c | byte to include in the CRC value being computed |
| void add | ( | int | count, | |
| const char * | s | |||
| ) |
Update CRC with contents of buffer.
| count | length of input buffer in bytes | |
| s | pointer to input buffer |
| void clear | ( | void | ) | [inline] |
Clear CRC object.
| void final | ( | void | ) | [inline] |
Perform final masking operation.
| void reset | ( | void | ) | [inline] |
Reset CRC object. Alias for clear().
| unsigned int sum | ( | ) | const [inline] |
Get final CRC value.
| T to | ( | ) | const [inline] |
Convert 32-bit CRC value to type T.
| str tostr | ( | ) | const |
Convert 32-bit CRC value to a str.
| ISC Cryptographic Development Kit - User's Guide | |
| Questions? E-mail ISC technical support | |
| Copyright© 2002-2006 Information Security Corp. All rights reserved. |