Function
GLibcompute_hmac_for_string
since: 2.30
Declaration [src]
gchar*
g_compute_hmac_for_string(
GChecksumTypedigest_type,
constguchar*key,
gsizekey_len,
constgchar*str,
gssizelength
)
Description [src]
Computes the HMAC for a string.
The hexadecimal string returned will be in lower case.
Available since: 2.30
Parameters
digest_type-
Type:
GChecksumTypeA
GChecksumTypeto use for the HMAC. key-
Type: An array of
gucharThe key to use in the HMAC.
The length of the array is specified in thekey_lenargument.The data is owned by the caller of the function. key_len-
Type:
gsizeThe length of the key.
str-
Type:
const gchar*The string to compute the HMAC for.
The data is owned by the caller of the function.The value is a NUL terminated UTF-8 string. length-
Type:
gssizeThe length of the string, or -1 if the string is nul-terminated.
Return value
Type: gchar*
The HMAC as a hexadecimal string.
The returned string should be freed with g_free()
when done using it.
The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.