Checksum


Description:

public Checksum (ChecksumType checksum_type)

Creates a new Checksum, using the checksum algorithm checksum_type.

If the checksum_type is not known, null is returned. A Checksum can be used to compute the checksum, or digest, of an arbitrary binary blob, using different hashing algorithms.

A Checksum works by feeding a binary blob through update until there is data to be checked; the digest can then be extracted using get_string, which will return the checksum as a hexadecimal string; or get_digest, which will return a vector of raw bytes. Once either get_string or get_digest have been called on a Checksum, the checksum will be closed and it won't be possible to call update on it anymore.

Parameters:

checksum_type

the desired type of checksum

Returns:

the newly created Checksum, or null. Use g_checksum_free to free the memory allocated by it.