1 /* gchecksum.h - data hashing functions
3 * Copyright (C) 2007 Emmanuele Bassi <ebassi@gnome.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #ifndef __G_CHECKSUM_H__
22 #define __G_CHECKSUM_H__
24 #include <glib/gtypes.h>
30 * @G_CHECKSUM_MD5: Use the MD5 hashing algorithm
31 * @G_CHECKSUM_SHA1: Use the SHA-1 hashing algorithm
32 * @G_CHECKSUM_SHA256: Use the SHA-256 hashing algorithm
34 * The hashing algorithm to be used by #GChecksum when performing the
35 * digest of some data.
37 * The #GChecksumType enumeration can be extended at later date to include
38 * new hashing algorithm types.
48 typedef struct _GChecksum GChecksum;
50 GChecksum * g_checksum_new (GChecksumType checksum_type);
51 GChecksum * g_checksum_copy (const GChecksum *checksum);
52 void g_checksum_free (GChecksum *checksum);
53 void g_checksum_update (GChecksum *checksum,
56 G_CONST_RETURN gchar *g_checksum_get_string (GChecksum *checksum);
57 void g_checksum_get_digest (GChecksum *checksum,
61 gchar *g_compute_checksum_for_data (GChecksumType checksum_type,
64 gchar *g_compute_checksum_for_string (GChecksumType checksum_type,
70 #endif /* __G_CHECKSUM_H__ */