GLib.Hmac¶
Fields¶
None
Methods¶
|
|
|
|
|
|
|
Details¶
- class GLib.Hmac¶
An opaque structure representing a HMAC operation. To create a new
GLib.Hmac
, use g_hmac_new(). To free aGLib.Hmac
, useGLib.Hmac.unref
().New in version 2.30.
- get_digest(buffer)[source]¶
- Parameters:
buffer (
bytes
) – output buffer
Gets the digest from checksum as a raw binary array and places it into buffer. The size of the digest depends on the type of checksum.
Once this function has been called, the
GLib.Hmac
is closed and can no longer be updated withGLib.Checksum.update
().New in version 2.30.
- get_string()[source]¶
- Returns:
the hexadecimal representation of the HMAC. The returned string is owned by the HMAC and should not be modified or freed.
- Return type:
Gets the HMAC as a hexadecimal string.
Once this function has been called the
GLib.Hmac
can no longer be updated withGLib.Hmac.update
().The hexadecimal characters will be lower case.
New in version 2.30.
- unref()[source]¶
Atomically decrements the reference count of self by one.
If the reference count drops to 0, all keys and values will be destroyed, and all memory allocated by the hash table is released. This function is MT-safe and may be called from any thread. Frees the memory allocated for self.
New in version 2.30.
- update(data)[source]¶
- Parameters:
data (
bytes
) – buffer used to compute the checksum
Feeds data into an existing
GLib.Hmac
.The HMAC must still be open, that is
GLib.Hmac.get_string
() orGLib.Hmac.get_digest
() must not have been called on self.New in version 2.30.