Library API
    Preparing search index...

    Function hmac

    • Generates a Hash-based Message Authentication Code (HMAC) for a given source payload.

      Parameters

      • source: string | Object

        The data to hash

      • secret: string

        The secret key used for hashing

      • alg: string = 'SHA-512'

        The hash algorithm to use (default: 'SHA-512')

      • Optionallen: number

        Optional length to truncate the resulting hex string

      Returns Promise<string>

      A promise resolving to the HMAC hex string