# MATH_CRC*GetHash

## C Specification

      #include <nitro/math/crc.h>

      static inline u8 MATH_CRC8GetHash( MATHCRC8Context *context );
      static inline u16 MATH_CRC16GetHash( MATHCRC16Context *context );
      static inline u16 MATH_CRC16CCITTGetHash( MATHCRC16Context *context );
      static inline u32 MATH_CRC32GetHash( MATHCRC32Context *context );
      static inline u32 MATH_CRC32POSIXGetHash( MATHCRC32Context *context );

## Arguments

`context` | Pointer to the context structure for CRC* generation.

## Return Values

None.

## Description

Obtains the hash value based on various CRCs. You must first initialize the 'context' argument using `MATH_CRC*Init` and then provide the input data using `MATH_CRC*Update`.
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*Init`, `MATH_CRC*Update`

## Revision History

04/12/2005 Initial version.

CONFIDENTIAL