<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html><head><title>QCryptographicHash Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } td.postheader { font-family: sans-serif } tr.address { font-family: sans-serif } body { background: #ffffff; color: black; } </style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QCryptographicHash Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QCryptographicHash class provides a way to generate cryptographic hashes. <a href="#details">More...</a></p> <h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qcryptographichash.html#Algorithm-enum">Algorithm</a></b> { Md4, Md5, Sha1 }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qcryptographichash.html#QCryptographicHash">__init__</a></b> (<i>self</i>, Algorithm <i>method</i>)</li><li><div class="fn" /><b><a href="qcryptographichash.html#addData">addData</a></b> (<i>self</i>, str <i>data</i>)</li><li><div class="fn" /><b><a href="qcryptographichash.html#addData-2">addData</a></b> (<i>self</i>, QByteArray <i>data</i>)</li><li><div class="fn" /><b><a href="qcryptographichash.html#reset">reset</a></b> (<i>self</i>)</li><li><div class="fn" />QByteArray <b><a href="qcryptographichash.html#result">result</a></b> (<i>self</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />QByteArray <b><a href="qcryptographichash.html#hash">hash</a></b> (QByteArray <i>data</i>, Algorithm <i>method</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QCryptographicHash class provides a way to generate cryptographic hashes.</p> <p>QCryptographicHash can be used to generate cryptographic hashes of binary or text data.</p> <p>Currently MD4, MD5, and SHA-1 are supported.</p> <hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Algorithm-enum" />QCryptographicHash.Algorithm</h3><table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QCryptographicHash.Md4</tt></td> <td class="topAlign"><tt>0</tt></td> <td class="topAlign">Generate an MD4 hash sum</td> </tr> <tr> <td class="topAlign"><tt>QCryptographicHash.Md5</tt></td> <td class="topAlign"><tt>1</tt></td> <td class="topAlign">Generate an MD5 hash sum</td> </tr> <tr> <td class="topAlign"><tt>QCryptographicHash.Sha1</tt></td> <td class="topAlign"><tt>2</tt></td> <td class="topAlign">Generate an SHA1 hash sum</td> </tr> </table> <hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QCryptographicHash" />QCryptographicHash.__init__ (<i>self</i>, <a href="qcryptographichash.html#Algorithm-enum">Algorithm</a> <i>method</i>)</h3><p>Constructs an object that can be used to create a cryptographic hash from data using <i>method</i>.</p> <h3 class="fn"><a name="addData" />QCryptographicHash.addData (<i>self</i>, str <i>data</i>)</h3><p>Adds the first <i>length</i> chars of <i>data</i> to the cryptographic hash.</p> <h3 class="fn"><a name="addData-2" />QCryptographicHash.addData (<i>self</i>, <a href="qbytearray.html">QByteArray</a> <i>data</i>)</h3><p>This function overloads <a href="qcryptographichash.html#addData">addData</a>().</p> <h3 class="fn"><a name="hash" /><a href="qbytearray.html">QByteArray</a> QCryptographicHash.hash (<a href="qbytearray.html">QByteArray</a> <i>data</i>, <a href="qcryptographichash.html#Algorithm-enum">Algorithm</a> <i>method</i>)</h3><p>Returns the hash of <i>data</i> using <i>method</i>.</p> <h3 class="fn"><a name="reset" />QCryptographicHash.reset (<i>self</i>)</h3><p>Resets the object.</p> <h3 class="fn"><a name="result" /><a href="qbytearray.html">QByteArray</a> QCryptographicHash.result (<i>self</i>)</h3><p>Returns the final hash value.</p> <p><b>See also</b> <a href="qbytearray.html#toHex">QByteArray.toHex</a>().</p> <address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.10.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>