GNet Network Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# md5

## Name

md5 --

## 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.

`buffer` : |
`length` : |
Returns : |

### 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.

`str` : |
Returns : |

### gnet_md5_clone ()

    GMD5*       gnet_md5_clone                  (const GMD5 *gmd5);

Create a MD5 from another one.

`gmd5` : |
Returns : |

### gnet_md5_delete ()

    void        gnet_md5_delete                 (GMD5 *gmd5);

Delete a GMD5.

`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().

Returns : |

### 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.

`gmd5` : |
`buffer` : |
`length` : |

### 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.

`gmd5` : |

### gnet_md5_equal ()

    gint        gnet_md5_equal                  (gconstpointer p1,
                                                 gconstpointer p2);

Compare two GMD5's.

`p1` : |
`p2` : |
Returns : |

### 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.

`p` : |
Returns : |

### gnet_md5_get_digest ()

    guint8*     gnet_md5_get_digest             (const GMD5 *gmd5);

Get the MD5 hash digest.

`gmd5` : |
Returns : |

### gnet_md5_get_string ()

    gchar*      gnet_md5_get_string             (const GMD5 *gmd5);

Get a hash string.

`gmd5` : |
Returns : |

### gnet_md5_copy_string ()

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

Copy the hash string into the buffer.

`gmd5` : |
`buffer` : |

<<< Previous Page | Home | Up | Next Page >>>
pack | sha