Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > by-pkgid > 6282078ae76a671f49c6af38c67b1a07 > files > 507

kdelibs-devel-2.2.2-49.2mdk.i586.rpm

<HTML>
<HEAD>
<TITLE>class KMD5</TITLE>

<META NAME="Generator" CONTENT="KDOC ">
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
<TABLE WIDTH="100%" BORDER="0">
<TR>
<TD>
	<TABLE BORDER="0">
		<TR><TD valign="top" align="left" cellspacing="10">
		<h1>class KMD5</h1>
		</TD>
		<TD valign="top" align="right" colspan="1">An adapted C++ implementation of RSA Data Securities MD5 algorithm.
 <small><A HREF="#longdesc">More...</A></small></TD></TR>
	</TABLE>
	<HR>
	<TABLE BORDER="0">
		<TR><TH>Definition</TH><TD><code>#include &lt;<A HREF="kmdcodec_h.html">kmdcodec.h</A>&gt;</code></TD></TR>
<TR><TH><A HREF="full-list-KMD5.html">List of all Methods</A></TH></TR>
	</TABLE>
	</TD>
<TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR>
<TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR>
<TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR>
<TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR>
<TR><TD><small><A HREF="index.html">Index</A></small></TD></TR>
</TABLE></TD></TR></TABLE>
<h4>Public Types</h4><ul><LI>enum <A HREF="#ref1">DigestType</A> { BIN, HEX }
</LI>
<LI>enum <A HREF="#ref2">ErrorType</A> { ERR_NONE, ERR_ALREADY_FINALIZED, ERR_NOT_YET_FINALIZED,
                   ERR_CANNOT_READ_FILE, ERR_CANNOT_CLOSE_FILE }
</LI>
</ul><h4>Public Methods</h4><ul><LI>&nbsp;<b><A HREF="#ref3">KMD5</A></b> () 
</LI>
<LI>&nbsp;<b><A HREF="#ref4">KMD5</A></b> (Q_UINT8 * in) 
</LI>
<LI>&nbsp;<b><A HREF="#ref5">KMD5</A></b> (FILE *file) 
</LI>
<LI>&nbsp;<b><A HREF="#ref6">KMD5</A></b> (const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qbytearray.html">QByteArray</A>& a ) 
</LI>
<LI>&nbsp;<b><A HREF="#ref7">KMD5</A></b> (const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A>& in) 
</LI>
<LI>&nbsp;<b><A HREF="#ref8">KMD5</A></b> (const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A>& in) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref9">update</A></b> (const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qbytearray.html">QByteArray</A>& in ) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref10">update</A></b> (FILE *file, bool closeFile = false ) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref11">update</A></b> (Q_UINT8 * in, int len = -1 ) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref12">update</A></b> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A>& in ) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref13">update</A></b> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A>& in ) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref14">finalize</A></b> () 
</LI>
<LI>bool &nbsp;<b><A HREF="#ref15">verify</A></b> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A>& in, const char * msg_digest,
               DigestType type = HEX ) 
</LI>
<LI>bool &nbsp;<b><A HREF="#ref16">verify</A></b> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A>& in, const char * msg_digest,
               DigestType type = HEX ) 
</LI>
<LI>bool &nbsp;<b><A HREF="#ref17">verify</A></b> ( FILE* f, const char * msg_digest, DigestType type = HEX ) 
</LI>
<LI>bool &nbsp;<b><A HREF="#ref18">verify</A></b> ( const char* msg_digest, DigestType type = HEX ) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref19">reset</A></b> () 
</LI>
<LI>Q_UINT8* &nbsp;<b><A HREF="#ref20">rawDigest</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref21">rawDigest</A></b> ( HASH bin ) 
</LI>
<LI>char * &nbsp;<b><A HREF="#ref22">hexDigest</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref23">hexDigest</A></b> ( HASHHEX hex ) 
</LI>
<LI>bool &nbsp;<b><A HREF="#ref24">hasErrored</A></b> ()  const
</LI>
<LI>int &nbsp;<b><A HREF="#ref25">error</A></b> ()  const
</LI>
</ul><h4>Protected Methods</h4><ul><LI>void &nbsp;<b><A HREF="#ref26">init</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref27">transform</A></b> ( Q_UINT8 * buffer ) 
</LI>
<LI>bool &nbsp;<b><A HREF="#ref28">isDigestMatch</A></b> ( const char * msg_digest, DigestType type ) 
</LI>
</ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p>
 Provides an easy to use C++ implementation of RSA's
 MD5 algorithm.
</p>
<p> The default constructor is designed to provide much the same
 functionality as the most commonly used C-implementation while
 the other three constructors are meant to further simplify the
 message digest calculations by calculating the result in one
 single step.  Additionally, you have the ability to obtain the
 result in either raw (16-bytes) or hexidecimal formats (33-bytes)
 using <A HREF="KMD5.html#rawDigest">rawDigest</A> and <A HREF="KMD5.html#hexDigest">hexDigest</A> respectivelly, you can also
 reuse a single instance to make multiple message digest calculations
 by simply invoking @reset().
</p>
<p></p>

<H3>Useage:
</H3>
<p>
</p>
<p> A common useage of this class:
</p>
<p></p><table border="0" width="100%">
<tr>
<td bgcolor="#BEEAE0">
<pre>

  HASH rawResult;
  HASHHEX hexResult;
  <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A> test1 = "This is a simple test.";

  <A HREF="KMD5.html#KMD5">KMD5</A> context( test1 );
  context.<A HREF="KMD5.html#rawDigest">rawDigest</A>( rawResult );
  context.<A HREF="KMD5.html#hexDigest">hexDigest</A>( hexResult );
  printf ( "Raw Digest output: %s", rawResult );
  printf ( "Hex Digest output: %s", hexResult );

</pre>
</td></tr>

</table> <p>
</p>
<p> To cut down on the unnecessary overhead of creating multiple KMD5 objects,
 you can simply invoke <A HREF="KMD5.html#reset">reset</A>() to resue the same object in making another
 calculation:
</p>
<p></p><table border="0" width="100%">
<tr>
<td bgcolor="#BEEAE0">
<pre>

  context.<A HREF="KMD5.html#reset">reset</A>();
  context.<A HREF="KMD5.html#update">update</A>( <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A>("TWO") );
  context.<A HREF="KMD5.html#update">update</A>( <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A>("THREE") );
  printf ( "Raw Digest output: %s", static_cast<char*>(context.<A HREF="KMD5.html#rawDigest">rawDigest</A>()) );
  printf ( "Hex Digest output: %s", context.<A HREF="KMD5.html#hexDigest">hexDigest</A>() );

</pre>
</td></tr>

</table> <p>
</p>
<p> NOTE: Invoke <A HREF="KMD5.html#reset">reset</A>() deletes the previously calculated message
 digest value.  Thus, be sure to copy the previous result before you
 reuse the same object!  Also, if you use one of the convienence
 constructors you must first invoke reset(), before calling any of the
 update functions.  Otherwise, the call to <A HREF="KMD5.html#update">update</A> will fail.
</p>
<p> Here is an of KMD5 useage much along the same lines of how one would
 use the commonly available C-implementations of the MD5 algorithm:
</p>
<p></p><table border="0" width="100%">
<tr>
<td bgcolor="#BEEAE0">
<pre>

  <A HREF="KMD5.html#KMD5">KMD5</A> context;
  context.<A HREF="KMD5.html#update">update</A>(<A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A>("ONE"));
  context.<A HREF="KMD5.html#update">update</A>(<A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A>("TWO"));
  context.<A HREF="KMD5.html#update">update</A>(<A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A>("THREE"));
  context.<A HREF="KMD5.html#finalize">finalize</A>();
  printf ( "Raw Digest output: %s", static_cast<char*>(context.<A HREF="KMD5.html#rawDigest">rawDigest</A>()) );
  printf ( "Hex Digest output: %s", context.<A HREF="KMD5.html#hexDigest">hexDigest</A>() );

</pre>
</td></tr>

</table> <p>
</p>
<p></p>
<A NAME="DigestType"></A><A NAME="ref1"></A><table width="100%"><tr bgcolor="#eeeeee"><td>enum <strong>DigestType</strong> { BIN, HEX }
</td><td align="right"><h3><strong>DigestType</strong></h3></td></tr></table><p></p><p>
 HEX    hexidecimal representation of the message digest
 BIN    binary representation of the message digest
   </p>
<A NAME="ErrorType"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td>enum <strong>ErrorType</strong> { ERR_NONE, ERR_ALREADY_FINALIZED, ERR_NOT_YET_FINALIZED,
                   ERR_CANNOT_READ_FILE, ERR_CANNOT_CLOSE_FILE }
</td><td align="right"><h3><strong>ErrorType</strong></h3></td></tr></table><p></p><p>
 ERR_NONE                   no error occured. [default]
 ERR_ALREADY_FINALIZED      <A HREF="KMD5.html#finalize">finalize</A>() has already been invoked.
 ERR_NOT_YET_FINALIZED      <A HREF="KMD5.html#hexDigest">hexDigest</A>() or <A HREF="KMD5.html#rawDigest">rawDigest</A>() invoked before <A HREF="KMD5.html#finalize">finalize</A>().
 ERR_CANNOT_READ_FILE       indicates a problem while trying to read the given file.
 ERR_CANNOT_CLOSE_FILE      indicates a problem while trying to close the given file.
   </p>
<A NAME="KMD5"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>KMD5</strong> ()
<br></td><td align="right"><h3><strong>KMD5</strong></h3></td></tr></table><p></p><p>
 Default constructor that only performs initialization.
 Unlike the other constructors
   </p>
<A NAME="KMD5"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>KMD5</strong> (Q_UINT8 * in)
<br></td><td align="right"><h3><strong>KMD5</strong></h3></td></tr></table><p></p><p>
 Constructor that initializes, computes, and finalizes
 the message digest for the given string.
</p>
<p> NOTE: This is a convience constructor.  It is provided to
 allow compatiability with the C implementation of this digest.
   </p>
<A NAME="KMD5"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>KMD5</strong> (FILE *file)
<br></td><td align="right"><h3><strong>KMD5</strong></h3></td></tr></table><p></p><p>
 Constructor that initializes, computes, and finalizes
 the message digest for the given file.
</p>
<p> NOTE: This is a convience constructor.  As such it does
 not allow the update of the message after it has been
 invoked.  If you need to update the message after creating
 the constructor,
   </p>
<A NAME="KMD5"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>KMD5</strong> (const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qbytearray.html">QByteArray</A>& a )
<br></td><td align="right"><h3><strong>KMD5</strong></h3></td></tr></table><p></p><p>
 Same as above except it accepts a QByteArray as its argument.
   </p>
<A NAME="KMD5"></A><A NAME="ref7"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>KMD5</strong> (const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A>& in)
<br></td><td align="right"><h3><strong>KMD5</strong></h3></td></tr></table><p></p><p>
 Same as above except it accepts a QCString as its argument.
   </p>
<A NAME="KMD5"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>KMD5</strong> (const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A>& in)
<br></td><td align="right"><h3><strong>KMD5</strong></h3></td></tr></table><p></p><p>
 @deprcated.  Use <A HREF="KMD5.html#KMD5">KMD5</A>(const QCString& in) instead!
</p>
<p> <u>IMPORTANT:</u> This constructor has been depricated and
 will be removed in future release.  This is done to avoid
 loss of data from misuse of the function since it first
 converts the given data into Latin-1.  Additionally, this
 conversion is very slow!
   </p>
<A NAME="update"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>update</strong> (const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qbytearray.html">QByteArray</A>& in )
<br></td><td align="right"><h3><strong>update</strong></h3></td></tr></table><p></p><p>
 Updates the message to be digested.
</p>
<p></p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>input</i></TD><TD align="left" valign="top">message to be added to the digest (QByteArray).
   </TD></TR>
</TABLE></P>
<A NAME="update"></A><A NAME="ref10"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>update</strong> (FILE *file, bool closeFile = false )
<br></td><td align="right"><h3><strong>update</strong></h3></td></tr></table><p></p><p>
 Same as above except it accepts a pointer to FILE.
</p>
<p> NOTE that the file must have been already opened.  If you
 want the file to be automatically closed, set <code>closeFile</code>
 to TRUE.
</p>
<p></p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>file</i></TD><TD align="left" valign="top">a pointer to FILE as returned by calls like f{d,re}open
</TD></TR>
<TR><TD align="left" valign="top"><i>closeFile</i></TD><TD align="left" valign="top">if true closes the file using fclose.
   </TD></TR>
</TABLE></P>
<A NAME="update"></A><A NAME="ref11"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>update</strong> (Q_UINT8 * in, int len = -1 )
<br></td><td align="right"><h3><strong>update</strong></h3></td></tr></table><p></p><p>
 Updates the message to be digested.
</p>
<p></p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>input</i></TD><TD align="left" valign="top">message to be added to digest (unsigned char*)
</TD></TR>
<TR><TD align="left" valign="top"><i>len</i></TD><TD align="left" valign="top">the length of the given message.
   </TD></TR>
</TABLE></P>
<A NAME="update"></A><A NAME="ref12"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>update</strong> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A>& in )
<br></td><td align="right"><h3><strong>update</strong></h3></td></tr></table><p></p><p>
 Same as above except it accepts a QCString as its argument.
   </p>
<A NAME="update"></A><A NAME="ref13"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>update</strong> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A>& in )
<br></td><td align="right"><h3><strong>update</strong></h3></td></tr></table><p></p><p>
 Same as above except it accepts a QString as its argument.
</p>
<p> <u>IMPORTANT:</u> This function is ONLY provided for convenience
 and backward compatability!  Using it can result in an incorrect
 digest caclculation since the conversion of the QString input to
 latin-1 can and will result in data loss if the input data contains
 non-latin1 characters.  As such it is highly recommended that you
 avoid this function unless you are absolutely certain that your
 input does not contain any non-latin1 character!!
   </p>
<A NAME="finalize"></A><A NAME="ref14"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>finalize</strong> ()
<br></td><td align="right"><h3><strong>finalize</strong></h3></td></tr></table><p></p><p>
 Finalizes the message digest calculation.
</p>
<p> If you used the default constructor, you must invoke this function
 before you can obtain the calculated digest value.
   </p>
<A NAME="verify"></A><A NAME="ref15"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool &nbsp;<strong>verify</strong> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qcstring.html">QCString</A>& in, const char * msg_digest,
               DigestType type = HEX )
<br></td><td align="right"><h3><strong>verify</strong></h3></td></tr></table><p></p><p>
 Compares the message digest supplied messaged digest <code>msg_digest</code>
 with the one calculated for the input QCString <code>input</code>.
</p>
<p> <u>NOTE:</u> Calling this function will reset any previously calcualted
 digests.  If you want to verify your token with the current digest
 value, use <A HREF="KMD5.html#verify">verify</A>( const char*, DigestType ) instead.
</p>
<p></p>
<p></p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>input</i></TD><TD align="left" valign="top">the message to be added to the digest value
</TD></TR>
<TR><TD align="left" valign="top"><i>msg_digest</i></TD><TD align="left" valign="top">the digest to compare the result against
</TD></TR>
<TR><TD align="left" valign="top"><i>type</i></TD><TD align="left" valign="top">the format of the result for comparison (binary or hexidecimal).
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: true if the digests match, otherwise false.
   </p>
<A NAME="verify"></A><A NAME="ref16"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool &nbsp;<strong>verify</strong> ( const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A>& in, const char * msg_digest,
               DigestType type = HEX )
<br></td><td align="right"><h3><strong>verify</strong></h3></td></tr></table><p></p><p>
 Same as above except it takes a QString argument as its input.
</p>
<p> <u>IMPORTANT:</u> This function is ONLY provided for convenience
 and backward compatability!  Using it can result in an incorrect
 verification since the conversion of the QString input to latin-1
 can and will result in data loss if the input data contains non-
 latin1 characters.  As such it is highly recommended that you
 avoid this function unless you are absolutely certain that your
 input does not contain any non-latin1 character!!
   </p>
<A NAME="verify"></A><A NAME="ref17"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool &nbsp;<strong>verify</strong> ( FILE* f, const char * msg_digest, DigestType type = HEX )
<br></td><td align="right"><h3><strong>verify</strong></h3></td></tr></table><p></p><p>
 Same as above except it takes a pointer to a FILE as its input.
</p>
<p> <u>NOTE:</u> Calling this function will reset any previously
 calcualted digests.  If you want to verify your token with the
 current digest value, use <A HREF="KMD5.html#verify">verify</A>(const char*, DigestType)
 instead.
   </p>
<A NAME="verify"></A><A NAME="ref18"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool &nbsp;<strong>verify</strong> ( const char* msg_digest, DigestType type = HEX )
<br></td><td align="right"><h3><strong>verify</strong></h3></td></tr></table><p></p><p>
 Compares the given string with with the current message digest.
</p>
<p> Unlike the other verification functions this one does not reset
 the calculated message digest if one is already present.  Rather
 it simply compares the given digest value against the calculated
 one.
</p>
<p> <u>NOTE:</u> This function will return false if there was an error
 calculating the message digest as well as when the verification
 fails. You can use <A HREF="KMD5.html#hasErrored">hasErrored</A>() to determine which is the case.
</p>
<p></p>
<p></p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>msg_digest</i></TD><TD align="left" valign="top">the digest to compare the result against
</TD></TR>
<TR><TD align="left" valign="top"><i>type</i></TD><TD align="left" valign="top">the format of the result for comparison (binary
                    or hexidecimal).
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: true if the digests match, otherwise false.
   </p>
<A NAME="reset"></A><A NAME="ref19"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>reset</strong> ()
<br></td><td align="right"><h3><strong>reset</strong></h3></td></tr></table><p></p><p>
  Re-initializes internal paramters.
</p>
<p> Note that calling this function will reset all internal variables
 and hence any calculated message digest.  Invoke this function only
 when you reuse the same object to perform another message digest
 calculation.
   </p>
<A NAME="rawDigest"></A><A NAME="ref20"></A><table width="100%"><tr bgcolor="#eeeeee"><td>Q_UINT8* &nbsp;<strong>rawDigest</strong> ()
<br></td><td align="right"><h3><strong>rawDigest</strong></h3></td></tr></table><p></p><p>
 Returns the raw 16-byte binary value of the message
 digest.
</p>
<p> NOTE: you are responsible for making a copy of this
 string.
</p>
<p></p>
<p><b>Returns</b>: the raw represenation of the digest or NULL
         if there was error calculating the digest.
   </p>
<A NAME="rawDigest"></A><A NAME="ref21"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>rawDigest</strong> ( HASH bin )
<br></td><td align="right"><h3><strong>rawDigest</strong></h3></td></tr></table><p></p><p>
 Fills the given array with the binary representation of the
 message digest.
</p>
<p> Use this method if you do not want to worry about making
 copy of the digest once you obtain it.
</p>
<p></p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>bin</i></TD><TD align="left" valign="top">an array of 16 characters ( char[16] )
   </TD></TR>
</TABLE></P>
<A NAME="hexDigest"></A><A NAME="ref22"></A><table width="100%"><tr bgcolor="#eeeeee"><td>char * &nbsp;<strong>hexDigest</strong> ()
<br></td><td align="right"><h3><strong>hexDigest</strong></h3></td></tr></table><p></p><p>
 Returns the value of the calculated message digest in
 a hexcidecimal representation.
</p>
<p> The 32-byte hexidecimal value is terminated by a NULL
 character to form a properly terminated string.  Also
 note that that if
</p>
<p> NOTE: You are responsible for making a copy of
 this string!
</p>
<p></p>
<p><b>Returns</b>: the hex represenation of the digest or NULL if
         there was error calculating the digest.
   </p>
<A NAME="hexDigest"></A><A NAME="ref23"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>hexDigest</strong> ( HASHHEX hex )
<br></td><td align="right"><h3><strong>hexDigest</strong></h3></td></tr></table><p></p><p>
 Fills the given array with the hexcidecimal representation of
 the message digest.
</p>
<p> Use this method if you do not want to worry about making
 copy of the digest once you obtain it.  Also note that this
 method appends a NULL charater to the end of the array to
 form a properly terminated string.  This is the reason why
 the hexDigest is 33 characters long.
</p>
<p></p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>bin</i></TD><TD align="left" valign="top">an array of 33 characters ( char[33] )
   </TD></TR>
</TABLE></P>
<A NAME="hasErrored"></A><A NAME="ref24"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool &nbsp;<strong>hasErrored</strong> ()
<br></td><td align="right"><h3><strong>hasErrored</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
 Indicates whether the message digest calculation failed or
 succeeded.  Use <A HREF="KMD5.html#error">error</A>() to determine the error type.
</p>
<p></p>
<p><b>Returns</b>: false if errors are present, otherwise true
   </p>
<A NAME="error"></A><A NAME="ref25"></A><table width="100%"><tr bgcolor="#eeeeee"><td>int &nbsp;<strong>error</strong> ()
<br></td><td align="right"><h3><strong>error</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
 Returns the type of error that occurred.
</p>
<p></p>
<p><b>Returns</b>: the error type. See <A HREF="KMD5.html#ErrorType">ErrorType</A> for details.
   </p>
<A NAME="init"></A><A NAME="ref26"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>init</strong> ()
<br></td><td align="right"><h3><strong>init</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
  Initializer called by all constructors
   </p>
<A NAME="transform"></A><A NAME="ref27"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>transform</strong> ( Q_UINT8 * buffer )
<br></td><td align="right"><h3><strong>transform</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
  Performs the real update work.  Note
  that length is implied to be 64.
   </p>
<A NAME="isDigestMatch"></A><A NAME="ref28"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool &nbsp;<strong>isDigestMatch</strong> ( const char * msg_digest, DigestType type )
<br></td><td align="right"><h3><strong>isDigestMatch</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
 Returns true if the current message digest matches <code>msg_digest</code>.
   </p>
<HR><UL><LI><i>Author</i>: Dawit Alemayehu <adawit@kde.org>
 </LI><LI><i>Generated</i>: qateam on updates.mandrakesoft.com on Mon Dec 30 16:08:56 2002, using kdoc 2.0a53.</LI></UL></BODY></HTML>