Function

GLib-2.0GLibcompute_hmac_for_dataSince 2.30

  • Computes the HMAC for a binary data of length. This is a convenience wrapper for g_hmac_new(), g_hmac_get_string() and g_hmac_unref().

    The hexadecimal string returned will be in lower case.

    Parameters

    • digest_type: ChecksumType

      a GLib.ChecksumType to use for the HMAC

    • key: string | Uint8Array<ArrayBufferLike>

      the key to use in the HMAC

    • data: string | Uint8Array<ArrayBufferLike>

      binary blob to compute the HMAC of

    Returns string

    the HMAC of the binary data as a string in hexadecimal. The returned string should be freed with g_free() when done using it.

    2.30