## AsChecksum AsChecksum — A single checksum used in a release. |

## Functions

const gchar * | as_checksum_kind_to_string ()
AsChecksumKind | as_checksum_kind_from_string ()
AsChecksum * | as_checksum_new ()
AsChecksum * | as_checksum_new_for_kind_value ()
AsChecksumKind | as_checksum_get_kind ()
void | as_checksum_set_kind ()
const gchar * | as_checksum_get_value ()
void | as_checksum_set_value ()

## Types and Values

#define | AS_TYPE_CHECKSUM
struct | AsChecksumClass
enum | AsChecksumKind
| AsChecksum

## Includes

    #include <appstream.h>

## Description

A checksum for a file referenced in a release.

See also: AsRelease

## Functions

### as_checksum_kind_to_string ()

    const gchar *
    as_checksum_kind_to_string (AsChecksumKind kind);

Converts the enumerated value to an text representation.

#### Parameters

kind | the `AsChecksumKind`. |

#### Returns

string version of `kind`

### as_checksum_kind_from_string ()

    AsChecksumKind
    as_checksum_kind_from_string (const gchar *kind_str);

Converts the text representation to an enumerated value.

#### Parameters

kind_str | the string. |

#### Returns

a AsChecksumKind or `AS_CHECKSUM_KIND_NONE` for unknown

### as_checksum_new ()

    AsChecksum *
    as_checksum_new (void);

Creates a new AsChecksum.

#### Returns

an AsChecksum.

[transfer full]

### as_checksum_new_for_kind_value ()

    AsChecksum *
    as_checksum_new_for_kind_value (AsChecksumKind kind,
                                    const gchar *value);

Creates a new AsChecksum with the given hash function and hash value.

#### Returns

an AsChecksum.

[transfer full]

Since: 0.12.11

### as_checksum_get_kind ()

    AsChecksumKind
    as_checksum_get_kind (AsChecksum *cs);

Gets the checksum type.

#### Parameters

cs | a AsChecksum instance. |

#### Returns

the AsChecksumKind

### as_checksum_set_kind ()

    void
    as_checksum_set_kind (AsChecksum *cs,
                          AsChecksumKind kind);

Sets the checksum type.

#### Parameters

cs | a AsChecksum instance. |
kind | the AsChecksumKind, e.g. `AS_CHECKSUM_KIND_SHA256`. |

### as_checksum_get_value ()

    const gchar *
    as_checksum_get_value (AsChecksum *cs);

Gets the checksum, usually in its hexadecimal form.

#### Parameters

cs | a AsChecksum instance. |

#### Returns

the checksum.

### as_checksum_set_value ()

    void
    as_checksum_set_value (AsChecksum *cs,
                           const gchar *value);

Sets the checksum value filename.

#### Parameters

cs | a AsChecksum instance. |
value | the new value. |

## Types and Values

### AS_TYPE_CHECKSUM

    #define AS_TYPE_CHECKSUM (as_checksum_get_type ())

### struct AsChecksumClass

    struct AsChecksumClass {
    	GObjectClass parent_class;
    };

### enum AsChecksumKind

Checksums supported by AsRelease

#### Members

AS_CHECKSUM_KIND_NONE | No checksum |
AS_CHECKSUM_KIND_SHA1 | SHA1 checksum |
AS_CHECKSUM_KIND_SHA256 | SHA256 checksum |
AS_CHECKSUM_KIND_BLAKE2B | BLAKE2b checksum |
AS_CHECKSUM_KIND_BLAKE2S | BLAKE2s checksum |

### AsChecksum

    typedef struct _AsChecksum AsChecksum;