File: exo-MD5-functions.html

package info (click to toggle)
exo 0.3.107-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,992 kB
  • ctags: 3,447
  • sloc: ansic: 24,999; sh: 10,429; makefile: 1,606; python: 403; perl: 235; xml: 130
file content (293 lines) | stat: -rw-r--r-- 15,466 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MD5 Functions</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="exo Reference Manual">
<link rel="up" href="exo-miscelleanous.html" title="Part VI. Miscelleanous">
<link rel="prev" href="exo-Executing-Applications.html" title="Executing Applications">
<link rel="next" href="exo-Mount-Points.html" title="Mount Points">
<meta name="generator" content="GTK-Doc V1.14 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="exo-Executing-Applications.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="exo-miscelleanous.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">exo Reference Manual</th>
<td><a accesskey="n" href="exo-Mount-Points.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#exo-MD5-functions.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#exo-MD5-functions.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="MD5 Functions">
<a name="exo-MD5-functions"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="exo-MD5-functions.top_of_page"></a>MD5 Functions</span></h2>
<p>MD5 Functions — MD5 hash implementation</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1" title="Stability Level">
<a name="exo-MD5-functions.stability-level"></a><h2>Stability Level</h2>
Stable, unless otherwise indicated
</div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="exo-MD5-functions.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;exo/exo.h&gt;

                    <a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest">ExoMd5Digest</a>;
<a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="returnvalue">ExoMd5Digest</span></a> *      <a class="link" href="exo-MD5-functions.html#exo-str-get-md5-digest" title="exo_str_get_md5_digest ()">exo_str_get_md5_digest</a>              (<em class="parameter"><code>const <span class="type">gchar</span> *contents</code></em>);
<span class="returnvalue">gchar</span> *             <a class="link" href="exo-MD5-functions.html#exo-str-get-md5-str" title="exo_str_get_md5_str ()">exo_str_get_md5_str</a>                 (<em class="parameter"><code>const <span class="type">gchar</span> *contents</code></em>);
<a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="returnvalue">ExoMd5Digest</span></a> *      <a class="link" href="exo-MD5-functions.html#exo-md5-str-to-digest" title="exo_md5_str_to_digest ()">exo_md5_str_to_digest</a>               (<em class="parameter"><code>const <span class="type">gchar</span> *str_digest</code></em>);
<span class="returnvalue">gchar</span> *             <a class="link" href="exo-MD5-functions.html#exo-md5-digest-to-str" title="exo_md5_digest_to_str ()">exo_md5_digest_to_str</a>               (<em class="parameter"><code>const <a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="type">ExoMd5Digest</span></a> *digest</code></em>);
<a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="returnvalue">ExoMd5Digest</span></a> *      <a class="link" href="exo-MD5-functions.html#exo-md5-digest-dup" title="exo_md5_digest_dup ()">exo_md5_digest_dup</a>                  (<em class="parameter"><code>const <a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="type">ExoMd5Digest</span></a> *digest</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="exo-MD5-functions.html#exo-md5-digest-free" title="exo_md5_digest_free ()">exo_md5_digest_free</a>                 (<em class="parameter"><code><a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="type">ExoMd5Digest</span></a> *digest</code></em>);
<span class="returnvalue">guint</span>               <a class="link" href="exo-MD5-functions.html#exo-md5-digest-hash" title="exo_md5_digest_hash ()">exo_md5_digest_hash</a>                 (<em class="parameter"><code><span class="type">gconstpointer</span> digest</code></em>);
<span class="returnvalue">gboolean</span>            <a class="link" href="exo-MD5-functions.html#exo-md5-digest-equal" title="exo_md5_digest_equal ()">exo_md5_digest_equal</a>                (<em class="parameter"><code><span class="type">gconstpointer</span> digest1</code></em>,
                                                         <em class="parameter"><code><span class="type">gconstpointer</span> digest2</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="exo-MD5-functions.description"></a><h2>Description</h2>
<p>
  This is an implementation 16-byte MD5 hash algorithm with some
  related utility functions.
</p>
</div>
<div class="refsect1" title="Details">
<a name="exo-MD5-functions.details"></a><h2>Details</h2>
<div class="refsect2" title="ExoMd5Digest">
<a name="ExoMd5Digest"></a><h3>ExoMd5Digest</h3>
<pre class="programlisting">typedef struct {
  guchar digest[16];
} ExoMd5Digest;
</pre>
<p>
  Structure to represent a MD5 digest.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="type">guchar</span> <em class="structfield"><code><a name="ExoMd5Digest.digest"></a>digest</code></em>[16];</span></p></td>
<td>the MD5 digest.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="exo_str_get_md5_digest ()">
<a name="exo-str-get-md5-digest"></a><h3>exo_str_get_md5_digest ()</h3>
<pre class="programlisting"><a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="returnvalue">ExoMd5Digest</span></a> *      exo_str_get_md5_digest              (<em class="parameter"><code>const <span class="type">gchar</span> *contents</code></em>);</pre>
<p>
Creates a binary MD5 digest of the string <em class="parameter"><code>contents</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>contents</code></em> :</span></p></td>
<td>The string to create a digest of.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new binary MD5 digest. It should be freed
              with <a class="link" href="exo-MD5-functions.html#exo-md5-digest-free" title="exo_md5_digest_free ()"><code class="function">exo_md5_digest_free()</code></a> when no longer
              needed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="exo_str_get_md5_str ()">
<a name="exo-str-get-md5-str"></a><h3>exo_str_get_md5_str ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> *             exo_str_get_md5_str                 (<em class="parameter"><code>const <span class="type">gchar</span> *contents</code></em>);</pre>
<p>
Creates a character array MD5 digestof the string
<em class="parameter"><code>contents</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>contents</code></em> :</span></p></td>
<td>The string to create a digest of.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A newly-allocated character array which
              should be free with <code class="function">g_free()</code> when no
              longer needed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="exo_md5_str_to_digest ()">
<a name="exo-md5-str-to-digest"></a><h3>exo_md5_str_to_digest ()</h3>
<pre class="programlisting"><a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="returnvalue">ExoMd5Digest</span></a> *      exo_md5_str_to_digest               (<em class="parameter"><code>const <span class="type">gchar</span> *str_digest</code></em>);</pre>
<p>
Converts thq <em class="parameter"><code>str_digest</code></em> character array digest
into a binary digest.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>str_digest</code></em> :</span></p></td>
<td>The character array digest to convert.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A newly allocated binary digest. It should
              be freed with <a class="link" href="exo-MD5-functions.html#exo-md5-digest-free" title="exo_md5_digest_free ()"><code class="function">exo_md5_digest_free()</code></a> when
              no longer needed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="exo_md5_digest_to_str ()">
<a name="exo-md5-digest-to-str"></a><h3>exo_md5_digest_to_str ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> *             exo_md5_digest_to_str               (<em class="parameter"><code>const <a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="type">ExoMd5Digest</span></a> *digest</code></em>);</pre>
<p>
Converts the binary <em class="parameter"><code>digest</code></em> to an ASCII character array
digest. The result can be used as an ordinary C string.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>digest</code></em> :</span></p></td>
<td>The binary MD5 digest to convert.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A newly-allocated character array which
              should be freed with <code class="function">g_free()</code> when no
              longer needed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="exo_md5_digest_dup ()">
<a name="exo-md5-digest-dup"></a><h3>exo_md5_digest_dup ()</h3>
<pre class="programlisting"><a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="returnvalue">ExoMd5Digest</span></a> *      exo_md5_digest_dup                  (<em class="parameter"><code>const <a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="type">ExoMd5Digest</span></a> *digest</code></em>);</pre>
<p>
Duplicates the contents of the <em class="parameter"><code>digest</code></em> binary
MD5 digest.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>digest</code></em> :</span></p></td>
<td>The MD5 digest to copy.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new binary MD5 digest. It should
              be freed with <a class="link" href="exo-MD5-functions.html#exo-md5-digest-free" title="exo_md5_digest_free ()"><code class="function">exo_md5_digest_free()</code></a>
              when no longer needed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="exo_md5_digest_free ()">
<a name="exo-md5-digest-free"></a><h3>exo_md5_digest_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                exo_md5_digest_free                 (<em class="parameter"><code><a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="type">ExoMd5Digest</span></a> *digest</code></em>);</pre>
<p>
Frees the memory allocated for the MD5 binary
<em class="parameter"><code>digest</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>digest</code></em> :</span></p></td>
<td>The MD5 digest to free.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="exo_md5_digest_hash ()">
<a name="exo-md5-digest-hash"></a><h3>exo_md5_digest_hash ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span>               exo_md5_digest_hash                 (<em class="parameter"><code><span class="type">gconstpointer</span> digest</code></em>);</pre>
<p>
Gets the numeric hash of <em class="parameter"><code>digest</code></em>, for use
in <span class="type">GHashTable</span> and <span class="type">GCache</span>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>digest</code></em> :</span></p></td>
<td>The <a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="type">ExoMd5Digest</span></a> to hash.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> An unsigned integer hash of
              the digest;
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="exo_md5_digest_equal ()">
<a name="exo-md5-digest-equal"></a><h3>exo_md5_digest_equal ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>            exo_md5_digest_equal                (<em class="parameter"><code><span class="type">gconstpointer</span> digest1</code></em>,
                                                         <em class="parameter"><code><span class="type">gconstpointer</span> digest2</code></em>);</pre>
<p>
Tests the equality of <em class="parameter"><code>digest1</code></em> and <em class="parameter"><code>digest2</code></em>, useful for <span class="type">GHashTable</span> and
<span class="type">GCashe</span>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>digest1</code></em> :</span></p></td>
<td>the first <a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="type">ExoMd5Digest</span></a> to compare.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>digest2</code></em> :</span></p></td>
<td>the second <a class="link" href="exo-MD5-functions.html#ExoMd5Digest" title="ExoMd5Digest"><span class="type">ExoMd5Digest</span></a> to compare.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <code class="literal">TRUE</code> if both digests are equal, <code class="literal">FALSE</code> otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.14</div>
</body>
</html>