Library API
    Preparing search index...

    Function verifyHmac

    • Verifies an HMAC signature against the provided data and secret using constant-time comparison.

      Parameters

      • signature: BinaryData

        The signature buffer to verify

      • data: string | BinaryData

        The original data

      • secret: string | BinaryData

        The secret key as a string or binary buffer

      • alg: string = 'SHA-256'

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

      Returns Promise<boolean>

      A promise resolving to true if the HMAC signature matches