OSDN Git Service

Re-generated documents.
[mutilities/MUtilities.git] / docs / da / db0 / class_m_utils_1_1_hash_1_1_hash.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <meta name="generator" content="Doxygen 1.8.12"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>MuldeR&#39;s Utilities for Qt: MUtils::Hash::Hash Class Reference</title>
9 <link href="../../tabs.css" rel="stylesheet" type="text/css"/>
10 <script type="text/javascript" src="../../jquery.js"></script>
11 <script type="text/javascript" src="../../dynsections.js"></script>
12 <link href="../../search/search.css" rel="stylesheet" type="text/css"/>
13 <script type="text/javascript" src="../../search/searchdata.js"></script>
14 <script type="text/javascript" src="../../search/search.js"></script>
15 <link href="../../doxygen.css" rel="stylesheet" type="text/css" />
16 </head>
17 <body>
18 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
19 <div id="titlearea">
20 <table cellspacing="0" cellpadding="0">
21  <tbody>
22  <tr style="height: 56px;">
23   <td id="projectalign" style="padding-left: 0.5em;">
24    <div id="projectname">MuldeR&#39;s Utilities for Qt
25    </div>
26    <div id="projectbrief">MUtilities</div>
27   </td>
28  </tr>
29  </tbody>
30 </table>
31 </div>
32 <!-- end header part -->
33 <!-- Generated by Doxygen 1.8.12 -->
34 <script type="text/javascript">
35 var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
36 </script>
37 <script type="text/javascript" src="../../menudata.js"></script>
38 <script type="text/javascript" src="../../menu.js"></script>
39 <script type="text/javascript">
40 $(function() {
41   initMenu('../../',true,false,'search.php','Search');
42   $(document).ready(function() { init_search(); });
43 });
44 </script>
45 <div id="main-nav"></div>
46 <!-- window showing the filter options -->
47 <div id="MSearchSelectWindow"
48      onmouseover="return searchBox.OnSearchSelectShow()"
49      onmouseout="return searchBox.OnSearchSelectHide()"
50      onkeydown="return searchBox.OnSearchSelectKey(event)">
51 </div>
52
53 <!-- iframe showing the search results (closed by default) -->
54 <div id="MSearchResultsWindow">
55 <iframe src="javascript:void(0)" frameborder="0" 
56         name="MSearchResults" id="MSearchResults">
57 </iframe>
58 </div>
59
60 <div id="nav-path" class="navpath">
61   <ul>
62 <li class="navelem"><a class="el" href="../../d3/da6/namespace_m_utils.html">MUtils</a></li><li class="navelem"><b>Hash</b></li><li class="navelem"><a class="el" href="../../da/db0/class_m_utils_1_1_hash_1_1_hash.html">Hash</a></li>  </ul>
63 </div>
64 </div><!-- top -->
65 <div class="header">
66   <div class="summary">
67 <a href="#pub-methods">Public Member Functions</a> &#124;
68 <a href="#pro-methods">Protected Member Functions</a> &#124;
69 <a href="../../d2/ded/class_m_utils_1_1_hash_1_1_hash-members.html">List of all members</a>  </div>
70   <div class="headertitle">
71 <div class="title">MUtils::Hash::Hash Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
72 </div><!--header-->
73 <div class="contents">
74
75 <p>This abstract class specifies the generic interface for all support hash algorithms.  
76  <a href="../../da/db0/class_m_utils_1_1_hash_1_1_hash.html#details">More...</a></p>
77
78 <p><code>#include &lt;<a class="el" href="../../d2/dad/_hash_8h_source.html">Hash.h</a>&gt;</code></p>
79 <table class="memberdecls">
80 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
81 Public Member Functions</h2></td></tr>
82 <tr class="memitem:a5c36bd2ea671928f9f5bd897dcfbef15"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/db0/class_m_utils_1_1_hash_1_1_hash.html#a5c36bd2ea671928f9f5bd897dcfbef15">update</a> (const quint8 *const data, const quint32 len)</td></tr>
83 <tr class="memdesc:a5c36bd2ea671928f9f5bd897dcfbef15"><td class="mdescLeft">&#160;</td><td class="mdescRight">Process the next chunk of input data.  <a href="#a5c36bd2ea671928f9f5bd897dcfbef15">More...</a><br /></td></tr>
84 <tr class="separator:a5c36bd2ea671928f9f5bd897dcfbef15"><td class="memSeparator" colspan="2">&#160;</td></tr>
85 <tr class="memitem:a16bef08766de745913b3fd7c338bf5aa"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/db0/class_m_utils_1_1_hash_1_1_hash.html#a16bef08766de745913b3fd7c338bf5aa">update</a> (const QByteArray &amp;data)</td></tr>
86 <tr class="memdesc:a16bef08766de745913b3fd7c338bf5aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Process the next chunk of input data.  <a href="#a16bef08766de745913b3fd7c338bf5aa">More...</a><br /></td></tr>
87 <tr class="separator:a16bef08766de745913b3fd7c338bf5aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
88 <tr class="memitem:ace90c97585350dd246b6c655a3de571f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/db0/class_m_utils_1_1_hash_1_1_hash.html#ace90c97585350dd246b6c655a3de571f">update</a> (QFile &amp;file)</td></tr>
89 <tr class="memdesc:ace90c97585350dd246b6c655a3de571f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Process the next chunk of input data.  <a href="#ace90c97585350dd246b6c655a3de571f">More...</a><br /></td></tr>
90 <tr class="separator:ace90c97585350dd246b6c655a3de571f"><td class="memSeparator" colspan="2">&#160;</td></tr>
91 <tr class="memitem:a1d70f2b647935868a178920196ec0ac1"><td class="memItemLeft" align="right" valign="top">QByteArray&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/db0/class_m_utils_1_1_hash_1_1_hash.html#a1d70f2b647935868a178920196ec0ac1">digest</a> (const bool bAsHex=true)</td></tr>
92 <tr class="memdesc:a1d70f2b647935868a178920196ec0ac1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the hash value.  <a href="#a1d70f2b647935868a178920196ec0ac1">More...</a><br /></td></tr>
93 <tr class="separator:a1d70f2b647935868a178920196ec0ac1"><td class="memSeparator" colspan="2">&#160;</td></tr>
94 </table><table class="memberdecls">
95 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
96 Protected Member Functions</h2></td></tr>
97 <tr class="memitem:ad6e33a1ff4e7e2f8247fa33ca4f7b16c"><td class="memItemLeft" align="right" valign="top"><a id="ad6e33a1ff4e7e2f8247fa33ca4f7b16c"></a>
98 &#160;</td><td class="memItemRight" valign="bottom"><b>Hash</b> (const char *=NULL)</td></tr>
99 <tr class="separator:ad6e33a1ff4e7e2f8247fa33ca4f7b16c"><td class="memSeparator" colspan="2">&#160;</td></tr>
100 <tr class="memitem:a498fa946e1cc599f85f745337f2263b9"><td class="memItemLeft" align="right" valign="top"><a id="a498fa946e1cc599f85f745337f2263b9"></a>
101 virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>process</b> (const quint8 *const data, const quint32 len)=0</td></tr>
102 <tr class="separator:a498fa946e1cc599f85f745337f2263b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
103 <tr class="memitem:ae2a22f932e25961380e796e245fddf89"><td class="memItemLeft" align="right" valign="top"><a id="ae2a22f932e25961380e796e245fddf89"></a>
104 virtual QByteArray&#160;</td><td class="memItemRight" valign="bottom"><b>finalize</b> (void)=0</td></tr>
105 <tr class="separator:ae2a22f932e25961380e796e245fddf89"><td class="memSeparator" colspan="2">&#160;</td></tr>
106 </table>
107 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
108 <div class="textblock"><p>This abstract class specifies the generic interface for all support hash algorithms. </p>
109 <p>In order to compute a hash value (digest) call the the <a class="el" href="../../da/db0/class_m_utils_1_1_hash_1_1_hash.html#a5c36bd2ea671928f9f5bd897dcfbef15" title="Process the next chunk of input data. ">Hash::update()</a> function repeatedly until all input data (i.e. the complete "message") has been processed. Then call the <a class="el" href="../../da/db0/class_m_utils_1_1_hash_1_1_hash.html#a1d70f2b647935868a178920196ec0ac1" title="Retrieve the hash value. ">Hash::digest()</a> function to retrieve the final hash value.</p>
110 <p>All overloads of the <a class="el" href="../../da/db0/class_m_utils_1_1_hash_1_1_hash.html#a5c36bd2ea671928f9f5bd897dcfbef15" title="Process the next chunk of input data. ">Hash::update()</a> function may be called in an interleaved fashion as needed.</p>
111 <p>This class is <b>not</b> thread-safe, i.e. do <b>not</b> call the <em>same</em> <a class="el" href="../../da/db0/class_m_utils_1_1_hash_1_1_hash.html" title="This abstract class specifies the generic interface for all support hash algorithms. ">Hash</a> instance from difference threads, unless serialization is ensured (e.g. by means of a Mutex). It is safe, however, to call different <em>different</em> <a class="el" href="../../da/db0/class_m_utils_1_1_hash_1_1_hash.html" title="This abstract class specifies the generic interface for all support hash algorithms. ">Hash</a> instances from difference threads concurrently. </p>
112 </div><h2 class="groupheader">Member Function Documentation</h2>
113 <a id="a1d70f2b647935868a178920196ec0ac1"></a>
114 <h2 class="memtitle"><span class="permalink"><a href="#a1d70f2b647935868a178920196ec0ac1">&sect;&nbsp;</a></span>digest()</h2>
115
116 <div class="memitem">
117 <div class="memproto">
118 <table class="mlabels">
119   <tr>
120   <td class="mlabels-left">
121       <table class="memname">
122         <tr>
123           <td class="memname">QByteArray MUtils::Hash::Hash::digest </td>
124           <td>(</td>
125           <td class="paramtype">const bool&#160;</td>
126           <td class="paramname"><em>bAsHex</em> = <code>true</code></td><td>)</td>
127           <td></td>
128         </tr>
129       </table>
130   </td>
131   <td class="mlabels-right">
132 <span class="mlabels"><span class="mlabel">inline</span></span>  </td>
133   </tr>
134 </table>
135 </div><div class="memdoc">
136
137 <p>Retrieve the hash value. </p>
138 <p>This function is used to retrieve the final hash value (digest), after all input data has been processed successfully.</p>
139 <dl class="params"><dt>Parameters</dt><dd>
140   <table class="params">
141     <tr><td class="paramname">bAsHex</td><td>If set to <code>true</code>, the function returns the hash value as a Hexadecimal-encoded ASCII string; if set to <code>false</code>, the function returns the hash value as "raw" bytes.</td></tr>
142   </table>
143   </dd>
144 </dl>
145 <dl class="section return"><dt>Returns</dt><dd>The function returns a QByteArray object holding the final hash value (digest). The format depends on the <code>bAsHex</code> parameter. </dd></dl>
146
147 </div>
148 </div>
149 <a id="a5c36bd2ea671928f9f5bd897dcfbef15"></a>
150 <h2 class="memtitle"><span class="permalink"><a href="#a5c36bd2ea671928f9f5bd897dcfbef15">&sect;&nbsp;</a></span>update() <span class="overload">[1/3]</span></h2>
151
152 <div class="memitem">
153 <div class="memproto">
154 <table class="mlabels">
155   <tr>
156   <td class="mlabels-left">
157       <table class="memname">
158         <tr>
159           <td class="memname">bool MUtils::Hash::Hash::update </td>
160           <td>(</td>
161           <td class="paramtype">const quint8 *const&#160;</td>
162           <td class="paramname"><em>data</em>, </td>
163         </tr>
164         <tr>
165           <td class="paramkey"></td>
166           <td></td>
167           <td class="paramtype">const quint32&#160;</td>
168           <td class="paramname"><em>len</em>&#160;</td>
169         </tr>
170         <tr>
171           <td></td>
172           <td>)</td>
173           <td></td><td></td>
174         </tr>
175       </table>
176   </td>
177   <td class="mlabels-right">
178 <span class="mlabels"><span class="mlabel">inline</span></span>  </td>
179   </tr>
180 </table>
181 </div><div class="memdoc">
182
183 <p>Process the next chunk of input data. </p>
184 <p>Updates the internal state of the hash function by processing the next chunk of input that. Can be called repeatedly, until until all input data has been processed.</p>
185 <dl class="params"><dt>Parameters</dt><dd>
186   <table class="params">
187     <tr><td class="paramname">data</td><td>A read-only pointer to the memory buffer holding the input data to be processed.</td></tr>
188     <tr><td class="paramname">len</td><td>The length of the input data, in bytes. The <code>data</code> parameter must be pointing to a memory buffer that is at least <code>len</code> bytes in size.</td></tr>
189   </table>
190   </dd>
191 </dl>
192 <dl class="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if the input data was processed successfully; otherwise it returns <code>false</code>. </dd></dl>
193
194 </div>
195 </div>
196 <a id="a16bef08766de745913b3fd7c338bf5aa"></a>
197 <h2 class="memtitle"><span class="permalink"><a href="#a16bef08766de745913b3fd7c338bf5aa">&sect;&nbsp;</a></span>update() <span class="overload">[2/3]</span></h2>
198
199 <div class="memitem">
200 <div class="memproto">
201 <table class="mlabels">
202   <tr>
203   <td class="mlabels-left">
204       <table class="memname">
205         <tr>
206           <td class="memname">bool MUtils::Hash::Hash::update </td>
207           <td>(</td>
208           <td class="paramtype">const QByteArray &amp;&#160;</td>
209           <td class="paramname"><em>data</em></td><td>)</td>
210           <td></td>
211         </tr>
212       </table>
213   </td>
214   <td class="mlabels-right">
215 <span class="mlabels"><span class="mlabel">inline</span></span>  </td>
216   </tr>
217 </table>
218 </div><div class="memdoc">
219
220 <p>Process the next chunk of input data. </p>
221 <p>Updates the internal state of the hash function by processing the next chunk of input that. Can be called repeatedly, until until all input data has been processed.</p>
222 <dl class="params"><dt>Parameters</dt><dd>
223   <table class="params">
224     <tr><td class="paramname">data</td><td>A read-only reference to a QByteArray object holding the input data to be processed. All bytes in the QByteArray object will be processed.</td></tr>
225   </table>
226   </dd>
227 </dl>
228 <dl class="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if the input data was processed successfully; otherwise it returns <code>false</code>. </dd></dl>
229
230 </div>
231 </div>
232 <a id="ace90c97585350dd246b6c655a3de571f"></a>
233 <h2 class="memtitle"><span class="permalink"><a href="#ace90c97585350dd246b6c655a3de571f">&sect;&nbsp;</a></span>update() <span class="overload">[3/3]</span></h2>
234
235 <div class="memitem">
236 <div class="memproto">
237       <table class="memname">
238         <tr>
239           <td class="memname">bool MUtils::Hash::Hash::update </td>
240           <td>(</td>
241           <td class="paramtype">QFile &amp;&#160;</td>
242           <td class="paramname"><em>file</em></td><td>)</td>
243           <td></td>
244         </tr>
245       </table>
246 </div><div class="memdoc">
247
248 <p>Process the next chunk of input data. </p>
249 <p>Updates the internal state of the hash function by processing the next chunk of input that. Can be called repeatedly, until until all input data has been processed.</p>
250 <dl class="params"><dt>Parameters</dt><dd>
251   <table class="params">
252     <tr><td class="paramname">data</td><td>A reference to a QFile object. The QFile object must be open and readable. All data from the current file position to the end of the file will be processed.</td></tr>
253   </table>
254   </dd>
255 </dl>
256 <dl class="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if all data in the file was processed successfully; otherwise (e.g. in case of file read errors) it returns <code>false</code>. </dd></dl>
257
258 </div>
259 </div>
260 <hr/>The documentation for this class was generated from the following file:<ul>
261 <li>include/MUtils/<a class="el" href="../../d2/dad/_hash_8h_source.html">Hash.h</a></li>
262 </ul>
263 </div><!-- contents -->
264 <!-- start footer part -->
265 <hr class="footer"/><address class="footer"><small>
266 Generated by &#160;<a href="http://www.doxygen.org/index.html">
267 <img class="footer" src="../../doxygen.png" alt="doxygen"/>
268 </a> 1.8.12
269 </small></address>
270 </body>
271 </html>