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.
GLib supports incremental checksums using the glib.checksum.Checksum data
structure, by calling glib.checksum.Checksum.update as long as there’s data
available and then using glib.checksum.Checksum.getString or
glib.checksum.Checksum.getDigest 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 func@GLib.compute_checksum_for_data
and func@GLib.compute_checksum_for_string, respectively.
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.Checksum, use glib.checksum.Checksum.new_. To free a glib.checksum.Checksum, use glib.checksum.Checksum.free.
GLib supports incremental checksums using the glib.checksum.Checksum data structure, by calling glib.checksum.Checksum.update as long as there’s data available and then using glib.checksum.Checksum.getString or glib.checksum.Checksum.getDigest 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 func@GLib.compute_checksum_for_data and func@GLib.compute_checksum_for_string, respectively.