HMAC-SHA256 of payload under secret, computed with WebCrypto
(globalThis.crypto.subtle), so it runs on Node 22+, Deno, Bun and Workers
with no Node built-ins. Strings are encoded as UTF-8.
Returns the raw 32-byte digest; encode it with toHex or
toBase64 to compare against a provider's signature header.
The promise rejects with a WebCrypto DataError for an empty secret, which
WebCrypto does not accept as an HMAC key. Check for a missing secret before
calling, as the providers do.
HMAC-SHA256 of
payloadundersecret, computed with WebCrypto (globalThis.crypto.subtle), so it runs on Node 22+, Deno, Bun and Workers with no Node built-ins. Strings are encoded as UTF-8.Returns the raw 32-byte digest; encode it with toHex or toBase64 to compare against a provider's signature header.
The promise rejects with a WebCrypto
DataErrorfor an emptysecret, which WebCrypto does not accept as an HMAC key. Check for a missing secret before calling, as the providers do.