Statistics
| Revision:

root / libsylph / md5.h @ 2640

History | View | Annotate | Download (1.2 kB)

1
/**
2
3
   This code is in the public domain.  See md5.c for details.
4
5
   Authors:
6
     Colin Plumb [original author]
7
     David Helder [GNet API]
8
9
   Modified the prefix of functions to prevent conflict with original GNet.
10
11
 */
12
13
14
#ifndef S_GNET_MD5_H
15
#define S_GNET_MD5_H
16
17
#include <glib.h>
18
19
#ifdef __cplusplus
20
extern "C" {
21
#endif /* __cplusplus */
22
23
/**
24
 *  SMD5
25
 *
26
 *  SMD5 is a MD5 hash.
27
 *
28
 **/
29
typedef struct _SMD5 SMD5;
30
31
/**
32
 *  S_GNET_MD5_HASH_LENGTH
33
 *
34
 *  Length of the MD5 hash in bytes.
35
 **/
36
#define S_GNET_MD5_HASH_LENGTH        16
37
38
39
SMD5*    s_gnet_md5_new (const guchar* buffer, guint length);
40
SMD5*         s_gnet_md5_new_string (const gchar* str);
41
SMD5*    s_gnet_md5_clone (const SMD5* md5);
42
void     s_gnet_md5_delete (SMD5* md5);
43
        
44
SMD5*         s_gnet_md5_new_incremental (void);
45
void         s_gnet_md5_update (SMD5* md5, const guchar* buffer, guint length);
46
void         s_gnet_md5_final (SMD5* md5);
47
        
48
gboolean s_gnet_md5_equal (gconstpointer p1, gconstpointer p2);
49
guint         s_gnet_md5_hash (gconstpointer p);
50
        
51
gchar*   s_gnet_md5_get_digest (const SMD5* md5);
52
gchar*   s_gnet_md5_get_string (const SMD5* md5);
53
        
54
void         s_gnet_md5_copy_string (const SMD5* md5, gchar* buffer);
55
56
57
#ifdef __cplusplus
58
}
59
#endif                                /* __cplusplus */
60
61
#endif /* S_GNET_MD5_H */