Copies a GLib.Checksum. If checksum has been closed, by calling
g_checksum_get_string() or g_checksum_get_digest(), the copied
checksum will be closed as well.
the copy of the passed GLib.Checksum. Use g_checksum_free() when finished using it.
Frees the memory allocated for checksum.
Gets the digest as a hexadecimal string.
Once this function has been called the GLib.Checksum can no longer be
updated with g_checksum_update().
The hexadecimal characters will be lower case.
the hexadecimal representation of the checksum. The returned string is owned by the checksum and should not be modified or freed.
Resets the state of the checksum back to its initial state.
Feeds data into an existing GLib.Checksum. The checksum must still be
open, that is g_checksum_get_string() or g_checksum_get_digest() must
not have been called on checksum.
buffer used to compute the checksum
StaticnewStatictype_Gets the length in bytes of digests of type checksum_type
GLib provides a generic API for computing checksums (or ‘digests’) for a sequence of arbitrary bytes, using various hashing algorithms like MD5, SHA-1 and SHA-256. Checksums are commonly used in various environments and specifications.
To create a new GLib.Checksum, use GLib.Checksum.new. To free a GLib.Checksum, use GLib.Checksum.free.
GLib supports incremental checksums using the GLib.Checksum data structure, by calling GLib.Checksum.update as long as there’s data available and then using GLib.Checksum.get_string or GLib.Checksum.get_digest to compute the checksum and return it either as a string in hexadecimal form, or as a raw sequence of bytes. To compute the checksum for binary blobs and nul-terminated strings in one go, use the convenience functions GLib.compute_checksum_for_data and GLib.compute_checksum_for_string, respectively.
Since
2.16