hammerspoon2-docs
    Preparing search index...

    Function hmac

    • Generate the HMAC (RFC 2104) of some bytes with a key, as bytes

      Parameters

      • algorithm: "MD5" | "SHA1" | "SHA256" | "SHA512"

        The hash algorithm

      • key: string | number[] | ArrayBuffer | Uint8Array<ArrayBufferLike>

        The secret key. A string is used as UTF-8

      • data: string | number[] | ArrayBuffer | Uint8Array<ArrayBufferLike>

        The data to authenticate. A string is used as UTF-8

      Returns Uint8Array

      The HMAC

      Throws an Error on failure; wrap calls in try/catch to handle it.