Function

GLib-2.0GLibcompute_hmac_for_stringSince 2.30

  • Computes the HMAC for a string.

    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

    • str: string

      the string to compute the HMAC for

    • length: number

      the length of the string, or -1 if the string is nul-terminated

    Returns string

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

    2.30