Mercurial > geeqie
annotate src/md5-util.h @ 1727:68b791050958
fixed toggle_slideshow function
https://sourceforge.net/tracker/index.php?func=detail&aid=2844302&group_id=222125&atid=1054680
author | nadvornik |
---|---|
date | Thu, 27 Aug 2009 20:23:28 +0000 |
parents | 51d70f62338c |
children |
rev | line source |
---|---|
9 | 1 /* |
2 * This code implements the MD5 message-digest algorithm. | |
3 * The algorithm is due to Ron Rivest. This code was | |
4 * written by Colin Plumb in 1993, no copyright is claimed. | |
5 * This code is in the public domain; do with it what you wish. | |
6 * | |
7 * Equivalent code is available from RSA Data Security, Inc. | |
8 * This code has been tested against that, and is equivalent, | |
9 * except that you don't need to include two pages of legalese | |
10 * with every copy. | |
11 * | |
12 * To compute the message digest of a chunk of bytes, declare an | |
13 * MD5Context structure, pass it to rpmMD5Init, call rpmMD5Update as | |
14 * needed on buffers full of bytes, and then call rpmMD5Final, which | |
15 * will fill a supplied 16-byte array with the digest. | |
16 */ | |
17 | |
18 /* parts of this file are : | |
19 * Written March 1993 by Branko Lankester | |
20 * Modified June 1993 by Colin Plumb for altered md5.c. | |
21 * Modified October 1995 by Erik Troan for RPM | |
22 */ | |
23 | |
24 | |
25 #ifndef MD5_UTIL_H | |
26 #define MD5_UTIL_H | |
27 | |
28 #include <glib.h> | |
29 | |
30 | |
31 typedef struct _MD5Context { | |
32 guint32 buf[4]; | |
33 guint32 bits[2]; | |
34 guchar in[64]; | |
35 gint doByteReverse; | |
36 } MD5Context; | |
37 | |
38 | |
39 /* raw routines */ | |
1346
c9949c19a6d0
No space between function name and first parenthesis, it eases greping (see CODING).
zas_
parents:
1055
diff
changeset
|
40 void md5_init(MD5Context *ctx); |
c9949c19a6d0
No space between function name and first parenthesis, it eases greping (see CODING).
zas_
parents:
1055
diff
changeset
|
41 void md5_update(MD5Context *ctx, const guchar *buf, guint32 len); |
c9949c19a6d0
No space between function name and first parenthesis, it eases greping (see CODING).
zas_
parents:
1055
diff
changeset
|
42 void md5_final(MD5Context *ctx, guchar digest[16]); |
9 | 43 |
44 /* generate digest from memory buffer */ | |
1346
c9949c19a6d0
No space between function name and first parenthesis, it eases greping (see CODING).
zas_
parents:
1055
diff
changeset
|
45 void md5_get_digest(const guchar *buffer, gint buffer_size, guchar digest[16]); |
9 | 46 |
47 /* generate digest from file */ | |
48 gboolean md5_get_digest_from_file(const gchar *path, guchar digest[16]); | |
49 | |
50 /* convert digest to/from a NULL terminated text string, in ascii encoding */ | |
51 gchar *md5_digest_to_text(guchar digest[16]); | |
52 gboolean md5_digest_from_text(const gchar *text, guchar digest[16]); | |
53 | |
54 | |
55 #endif /* MD5_UTILS_H */ | |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
446
diff
changeset
|
56 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |