1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3<head> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<title>MATH_CRC*GetHash</title> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</head> 10<body> 11<h1 align="left">MATH_CRC*GetHash <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<dl> 14 <dd> 15 <PRE><CODE>#include <nitro/math/crc.h> 16static inline u8 MATH_CRC8GetHash( <A href="MATHCRCContext.html">MATHCRC8Context</A> *context ); 17static inline u16 MATH_CRC16GetHash( <A href="MATHCRCContext.html">MATHCRC16Context</A> *context ); 18static inline u16 MATH_CRC16CCITTGetHash( <A href="MATHCRCContext.html">MATHCRC16Context</A> *context ); 19static inline u32 MATH_CRC32GetHash( <A href="MATHCRCContext.html">MATHCRC32Context</A> *context ); 20static inline u32 MATH_CRC32POSIXGetHash( <A href="MATHCRCContext.html">MATHCRC32Context</A> *context ); 21</CODE></PRE> 22 </dd> 23</dl><h2>Arguments</h2> 24<table border="1" width="100%"> 25 <TR> 26 <TD width="176"><em><strong><font face="Courier New"><em><strong><code>context</code></strong></em> </font></strong></em></TD> 27 <TD width="670">Pointer to the context structure for CRC* generation.</TD> 28 </TR> 29 </table> 30<h2>Return Values</h2> 31<p>None.</p> 32<H2>Description</H2> 33<P>Obtains the hash value based on various CRCs. You must use a <CODE><A href="MATH_CRCInit.html">MATH_CRC*Init</A></CODE> function to initialize the <CODE>context</CODE> argument, and then use a <CODE><A href="MATH_CRCUpdate.html">MATH_CRC*Update</A></CODE> function to provide the input data.<BR><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. 34</P> 35<h2>See Also</h2> 36<P><a href="MATH_CRCInit.html"><code>MATH_CRC*Init</code></a><BR> <a href="MATH_CRCUpdate.html"><code>MATH_CRC*Update</code></a></P> 37<H2>Revision History</H2> 38<P> 392005/04/12 Initial version. 40</P> 41<hr><p>CONFIDENTIAL</p></body> 42</html> 43