Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gchecksum.h
Go to the documentation of this file.
1/* gchecksum.h - data hashing functions
2 *
3 * Copyright (C) 2007 Emmanuele Bassi <ebassi@gnome.org>
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef __G_CHECKSUM_H__
22#define __G_CHECKSUM_H__
23
24#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
25#error "Only <glib.h> can be included directly."
26#endif
27
28#include <glib/gtypes.h>
29#include <glib/gbytes.h>
30
32
33/**
34 * GChecksumType:
35 * @G_CHECKSUM_MD5: Use the MD5 hashing algorithm
36 * @G_CHECKSUM_SHA1: Use the SHA-1 hashing algorithm
37 * @G_CHECKSUM_SHA256: Use the SHA-256 hashing algorithm
38 * @G_CHECKSUM_SHA384: Use the SHA-384 hashing algorithm (Since: 2.51)
39 * @G_CHECKSUM_SHA512: Use the SHA-512 hashing algorithm (Since: 2.36)
40 *
41 * The hashing algorithm to be used by #GChecksum when performing the
42 * digest of some data.
43 *
44 * Note that the #GChecksumType enumeration may be extended at a later
45 * date to include new hashing algorithm types.
46 *
47 * Since: 2.16
48 */
56
57typedef struct _GChecksum GChecksum;
58
61
65void g_checksum_reset (GChecksum *checksum);
69void g_checksum_free (GChecksum *checksum);
72 const guchar *data,
73 gssize length);
78 guint8 *buffer,
79 gsize *digest_len);
80
83 const guchar *data,
84 gsize length);
87 const gchar *str,
88 gssize length);
89
92 GBytes *data);
93
95
96#endif /* __G_CHECKSUM_H__ */
typedefG_BEGIN_DECLS struct _GBytes GBytes
Definition garray.h:38
GLIB_AVAILABLE_IN_ALL const gchar * g_checksum_get_string(GChecksum *checksum)
GLIB_AVAILABLE_IN_ALL void g_checksum_update(GChecksum *checksum, const guchar *data, gssize length)
GLIB_AVAILABLE_IN_2_34 gchar * g_compute_checksum_for_bytes(GChecksumType checksum_type, GBytes *data)
GLIB_AVAILABLE_IN_ALL GChecksum * g_checksum_new(GChecksumType checksum_type)
GLIB_AVAILABLE_IN_ALL void g_checksum_reset(GChecksum *checksum)
GLIB_AVAILABLE_IN_ALL gchar * g_compute_checksum_for_data(GChecksumType checksum_type, const guchar *data, gsize length)
GLIB_AVAILABLE_IN_ALL gchar * g_compute_checksum_for_string(GChecksumType checksum_type, const gchar *str, gssize length)
struct _GChecksum GChecksum
Definition gchecksum.h:57
GLIB_AVAILABLE_IN_ALL void g_checksum_get_digest(GChecksum *checksum, guint8 *buffer, gsize *digest_len)
GChecksumType
Definition gchecksum.h:49
@ G_CHECKSUM_SHA1
Definition gchecksum.h:51
@ G_CHECKSUM_SHA256
Definition gchecksum.h:52
@ G_CHECKSUM_SHA384
Definition gchecksum.h:54
@ G_CHECKSUM_MD5
Definition gchecksum.h:50
@ G_CHECKSUM_SHA512
Definition gchecksum.h:53
GLIB_AVAILABLE_IN_ALL void g_checksum_free(GChecksum *checksum)
GLIB_AVAILABLE_IN_ALL GChecksum * g_checksum_copy(const GChecksum *checksum)
GLIB_AVAILABLE_IN_ALL gssize g_checksum_type_get_length(GChecksumType checksum_type)
#define GLIB_AVAILABLE_IN_2_34
#define GLIB_AVAILABLE_IN_ALL
signed long gssize
Definition glibconfig.h:82
unsigned char guint8
Definition glibconfig.h:46
unsigned long gsize
Definition glibconfig.h:83
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
unsigned char guchar
Definition gtypes.h:58
G_BEGIN_DECLS typedef char gchar
Definition gtypes.h:52