2 * Copyright (C) 1993 Branko Lankester
3 * Copyright (C) 1993 Colin Plumb
4 * Copyright (C) 1995 Erik Troan
5 * Copyright (C) 2004 John Ellis
6 * Copyright (C) 2008 - 2016 The Geeqie Team
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 * This code implements the MD5 message-digest algorithm.
23 * The algorithm is due to Ron Rivest. This code was
24 * written by Colin Plumb in 1993, no copyright is claimed.
25 * This code is in the public domain; do with it what you wish.
27 * Equivalent code is available from RSA Data Security, Inc.
28 * This code has been tested against that, and is equivalent,
29 * except that you don't need to include two pages of legalese
32 * To compute the message digest of a chunk of bytes, declare an
33 * MD5Context structure, pass it to md5_init, call md5_update as
34 * needed on buffers full of bytes, and then call md5_Final, which
35 * will fill a supplied 16-byte array with the digest.
44 typedef struct _MD5Context {
53 void md5_init(MD5Context *ctx);
54 void md5_update(MD5Context *ctx, const guchar *buf, guint32 len);
55 void md5_final(MD5Context *ctx, guchar digest[16]);
58 * @headerfile md5_get_digest
59 * generate digest from memory buffer
61 void md5_get_digest(const guchar *buffer, gint buffer_size, guchar digest[16]);
64 * @headerfile md5_get_digest_from_file
65 * generate digest from file
67 gboolean md5_get_digest_from_file(const gchar *path, guchar digest[16]);
70 * @headerfile md5_digest_to_text
71 * convert digest to a NULL terminated text string, in ascii encoding
73 gchar *md5_digest_to_text(guchar digest[16]);
76 * @headerfile md5_digest_from_text
77 * convert digest from a NULL terminated text string, in ascii encoding
79 gboolean md5_digest_from_text(const gchar *text, guchar digest[16]);
82 #endif /* MD5_UTILS_H */
83 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */