1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>MATH_CRC*Init</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">MATH_CRC*Init <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></H1>
15<H2>Syntax</H2>
16
17<dl>
18  <dd>
19  <PRE><CODE>#include &lt;nitro/math/crc.h&gt;
20
21static inline void MATH_CRC8Init( <A href="MATHCRCContext.html">MATHCRC8Context</A> *context );
22static inline void MATH_CRC16Init( <A href="MATHCRCContext.html">MATHCRC16Context</A> *context );
23static inline void MATH_CRC16CCITTInit( <A href="MATHCRCContext.html">MATHCRC16Context</A> *context );
24static inline void MATH_CRC32Init( <A href="MATHCRCContext.html">MATHCRC32Context</A> *context );
25static inline void MATH_CRC32POSIXInit( <A href="MATHCRCContext.html">MATHCRC32Context</A> *context );
26</CODE></PRE>
27  </dd>
28</dl><h2>Arguments</h2>
29
30<table border="1" width="100%">
31    <TR>
32<TD width="176"><em><strong><font face="Courier New">context</font></strong></em></TD>
33<TD width="670">Pointer to the context structure to initialize for CRC calculations.</TD>
34    </TR>
35  </table>
36<h2>Return Values</h2>
37<p>None.</p>
38<H2>Description</H2>
39<P>Initializes a context structure of type <a href="MATHCRCContext.html"><code>MATHCRC*Context</code></a>, which is used for calculating CRCs.<br />Make sure that this function is called before using the <CODE><A href="MATH_CRCUpdate.html">MATH_CRC*Update</A></CODE> and <CODE><A href="MATH_CRCGetHash.html">MATH_CRC*GetHash</A></CODE> functions.<BR>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.<BR> CRC-8 is an algorithm that finds an 8-bit hash value.<BR> CRC-16 and CRC-16/CCITT are algorithms that find 16-bit hash values.<BR> 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 <code>0</code> 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 <code>cksum</code> command, CRC is taken after the file length is appended to the end of the input file.
40</P>
41<h2>See Also</h2>
42<P><a href="MATH_CRCUpdate.html"><code>MATH_CRC*Update</code></a><BR> <a href="MATH_CRCGetHash.html"><code>MATH_CRC*GetHash</code></a></P>
43<H2>Revision History</H2>
44<P>
452005/04/12 Initial version.
46</P>
47<hr><p>CONFIDENTIAL</p></body>
48</html>
49