MD5

Name

MD5 -- MD5 Hash

Synopsis



struct      GMD5;
#define     GNET_MD5_HASH_LENGTH
GMD5*       gnet_md5_new                    (const guchar *buffer,
                                             guint length);
GMD5*       gnet_md5_new_string             (const gchar *str);
GMD5*       gnet_md5_clone                  (const GMD5 *gmd5);
void        gnet_md5_delete                 (GMD5 *gmd5);
GMD5*       gnet_md5_new_incremental        (void);
void        gnet_md5_update                 (GMD5 *gmd5,
                                             const guchar *buffer,
                                             guint length);
void        gnet_md5_final                  (GMD5 *gmd5);
gint        gnet_md5_equal                  (gconstpointer p1,
                                             gconstpointer p2);
guint       gnet_md5_hash                   (gconstpointer p);
guint8*     gnet_md5_get_digest             (const GMD5 *gmd5);
gchar*      gnet_md5_get_string             (const GMD5 *gmd5);
void        gnet_md5_copy_string            (const GMD5 *gmd5,
                                             guchar *buffer);

Description

Details

struct GMD5

struct GMD5;


GNET_MD5_HASH_LENGTH

#define     GNET_MD5_HASH_LENGTH

Length of the MD5 hash in bytes.


gnet_md5_new ()

GMD5*       gnet_md5_new                    (const guchar *buffer,
                                             guint length);

Create an MD5 hash of the buffer.


gnet_md5_new_string ()

GMD5*       gnet_md5_new_string             (const gchar *str);

Create an MD5 hash from a hexidecimal string. The string must be of length greater than or equal to GNET_MD5_HASH_LENGTH * 2.


gnet_md5_clone ()

GMD5*       gnet_md5_clone                  (const GMD5 *gmd5);

Create a MD5 from another one.


gnet_md5_delete ()

void        gnet_md5_delete                 (GMD5 *gmd5);

Delete a GMD5.


gnet_md5_new_incremental ()

GMD5*       gnet_md5_new_incremental        (void);

Create a MD5 hash in incremental mode. After creating the GMD5, call gnet_md5_update() and gnet_md5_final().


gnet_md5_update ()

void        gnet_md5_update                 (GMD5 *gmd5,
                                             const guchar *buffer,
                                             guint length);

Update the hash with buffer. This may be called several times on an incremental hash before being finalized.


gnet_md5_final ()

void        gnet_md5_final                  (GMD5 *gmd5);

Calcuate the final hash value. This is called on a GMD5 created using gnet_md5_new_incremental() and updated using gnet_md5_update() possibly several times.


gnet_md5_equal ()

gint        gnet_md5_equal                  (gconstpointer p1,
                                             gconstpointer p2);

Compare two GMD5's.


gnet_md5_hash ()

guint       gnet_md5_hash                   (gconstpointer p);

Hash the GMD5 hash value. This is not the actual MD5 hash, but a hash of this hash.


gnet_md5_get_digest ()

guint8*     gnet_md5_get_digest             (const GMD5 *gmd5);

Get the MD5 hash digest.


gnet_md5_get_string ()

gchar*      gnet_md5_get_string             (const GMD5 *gmd5);

Get a hash string.


gnet_md5_copy_string ()

void        gnet_md5_copy_string            (const GMD5 *gmd5,
                                             guchar *buffer);

Copy the hash string into the buffer.