## GMimeFilterChecksum

GMimeFilterChecksum — Calculate a checksum

## Functions

GMimeFilter * | g_mime_filter_checksum_new ()
size_t | g_mime_filter_checksum_get_digest ()
gchar * | g_mime_filter_checksum_get_string ()

## Types and Values

struct | GMimeFilterChecksum

## Object Hierarchy

        GObject
        ╰── GMimeFilter
            ╰── GMimeFilterChecksum

## Description

Calculate a checksum for a stream.

## Functions

### g_mime_filter_checksum_new ()

    GMimeFilter *
    g_mime_filter_checksum_new (GChecksumType type);

Creates a new checksum filter.

#### Parameters

type | the type of checksum |

#### Returns

a new GMimeFilterChecksum filter.

### g_mime_filter_checksum_get_digest ()

    size_t
    g_mime_filter_checksum_get_digest (GMimeFilterChecksum *checksum,
                                       unsigned char *digest,
                                       size_t len);

Outputs the checksum digest into `digest` .

#### Parameters

checksum | checksum filter object |
digest | the digest buffer |
len | the length of the digest buffer |

#### Returns

the number of bytes used of the `digest` buffer.

### g_mime_filter_checksum_get_string ()

    gchar *
    g_mime_filter_checksum_get_string (GMimeFilterChecksum *checksum);

Outputs the checksum digest as a newly allocated hexadecimal string.

#### Parameters

checksum | checksum filter object |

#### Returns

the hexadecimal representation of the checksum. The returned string should be freed with `g_free()` when no longer needed.

## Types and Values

### struct GMimeFilterChecksum

    struct GMimeFilterChecksum;

A filter for calculating the checksum of a stream.

#### Members

## See Also

GMimeFilter