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_CalcCRC*</title> 9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">MATH_CalcCRC* <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 <nitro/math/crc.h> 20 21u8 MATH_CalcCRC8( const <A href="MATHCRCTable.html">MATHCRC8Table</A> *table, const void* data, u32 dataLength ); 22u16 MATH_CalcCRC16( const <A href="MATHCRCTable.html">MATHCRC16Table</A> *table, const void* data, u32 dataLength ); 23u16 MATH_CalcCRC16CCITT( const <A href="MATHCRCTable.html">MATHCRC16Table</A> *table, const void* data, u32 dataLength ); 24u32 MATH_CalcCRC32( const <A href="MATHCRCTable.html">MATHCRC32Table</A> *table, const void* data, u32 dataLength ); 25u32 MATH_CalcCRC32POSIX( const <A href="MATHCRCTable.html">MATHCRC32Table</A> *table, const void* data, u32 dataLength ); 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">table</font></strong></em></TD> 33 <TD width="670">Pointer to the tables used to compute CRCs.</TD> 34 </TR> 35 <TR> 36 <TD width="176"><em><strong><font face="Courier New">data</font></strong></em></TD> 37 <TD width="670">Pointer to the input data.</TD> 38 </TR> 39 <TR> 40 <TD width="176"><em><strong><font face="Courier New">dataLength</font></strong></em></TD> 41 <TD width="670">Size of the input data.</TD> 42 </TR> 43 </table> 44<h2>Return Values</h2> 45<p>Various CRC values</p> 46<H2>Description</H2> 47<P>Performs various CRC computations in one call. You must initialize the <CODE>table</CODE> argument by calling a <CODE><A href="MATH_CRCInitTable.html">MATH_CRC*InitTable</A></CODE> function in advance.<BR>Any size and alignment position can be used for the input data.<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. 48</P> 49<h2>See Also</h2> 50<P><a href="MATH_CRCInitTable.html"><code>MATH_CRC*InitTable</code></a>, <a href="MATH_CRCInit.html"><code>MATH_CRC*Init</code></a>, <a href="MATH_CRCUpdate.html"><code>MATH_CRC*Update</code></a>, <a href="MATH_CRCGetHash.html"><code>MATH_CRC*GetHash</code></a></P> 51<H2>Revision History</H2> 52<P> 532005/04/12 Initial version. 54</P> 55<hr><p>CONFIDENTIAL</p></body> 56</html> 57