# MATH_Checksum*Init

## C Specification

      #include <nitro/math/checksum.h>

      static inline void MATH_Checksum8Init( MATHChecksum8Context *context );
      static inline void MATH_Checksum16Init( MATHChecksum16Context *context );

## Arguments

`context` | Pointer to the context structure to initialize for calculating checksums.

## Return Values

None.

## Description

Initializes a context structure of type `MATHChecksum8Context` or `MATHChecksum16Context`, which is used for calculating 8-bit and 16-bit checksums. Make sure that this function is called before using `MATH_Checksum*Update` or `MATH_Checksum*GetHash`. You can re-apply this function to a context structure that is already initialized. In this case, it will return the context structure to its initial state. 8-bit Checksum is an algorithm to find the 8-bit hash value. It computes the one's complement of the one's complement sum in 8-bit units. 16-bit Checksum is an algorithm to find the 16-bit hash value. It computes the one's complement of the one's complement sum in 16-bit units. 16-bit Checksum returns the same value as IP Checksum or Internet Checksum, which are used with IP, UDP and TCP protocols. For details on Internet Checksum, see RFC (Request For Comments) 1071, which is published by IETF (The Internet Engineering Task Force).

## See Also

`MATH_Checksum*Update`, `MATH_Checksum*GetHash`

## Revision History

06/24/2005 Corrected error in C Specification.
04/12/2005 Initial version.

CONFIDENTIAL