MATH_CRC*InitTable

C Specification

#include <nitro/math/crc.h>

static inline void MATH_CRC8InitTable( MATHCRC8Table *context );
static inline void MATH_CRC16InitTable( MATHCRC16Table *context );
static inline void MATH_CRC16CCITTInitTable( MATHCRC16Table *context );
static inline void MATH_CRC32InitTable( MATHCRC32Table *context );
static inline void MATH_CRC32POSIXInitTable( MATHCRC32Table *context );

Arguments

table Pointer to the table to initialize for CRC calculations.

Return Values

None.

Description

Initializes a table of type MATHCRC*Table for prior calculation data. This table is used for calculating various CRCs. Call this function before calling MATH_CRC*Update or MATH_CalcCRC*. After calling this function once to initialize the table, you can use the same table for several CRC calculations, if you are using the same algorithm for all of them. However, CRC-16, CRC-16/CCITT, CRC-32 and CRC-32/POSIX all use different table contents, so be careful not to mix them up.
CRC-8 is an algorithm that finds an 8-bit hash value.
CRC-16 and CRC-16/CCITT are algorithms that find 16-bit hash values.
CRC-32 and CRC-32/POSIX are algorithms that find 32-bit hash values. CRC-16 is the algorithm used in the ARC and LHA compression programs. One restriction is that the hash value does not change when a 0 byte is appended to the top. CRC-16/CCITT is an algorithm that is used in many data link layer standards as a FCS (Frame Check Sequence). It is defined in the x.25 standard of the CCITT (Comite Consultatif International Telegraphique et Telephonique). CRC-32 is an algorithm used in compression programs, such as PKZIP, and image formats, such as PNG. For details, see ISO 3309 and RFC 2083. CRC-32/POSIX is an algorithm used in the cksum command, which is included in POSIX-compliant Unix. It is defined in POSIX 1003.2. With the cksum command, CRC is taken after the file length is appended to the end of the input file.

See Also

MATH_CRC*Update, MATH_CalcCRC*

Revision History

04/12/2005 Initial version.