Skip to Content
This project is in active development. Features and behaviors may change without notice.

calculateHmac

Type: calculateHmac(content: string): APIResult<string>

This method computes the HMAC (SHA-256) of the specified content string using the secretKey, and returns it as a hexadecimal string.


Parameters

OptionTypeDescription
contentstringThe string content to compute HMAC for

Return Value

APIResult<string> — Returns the calculated HMAC. If the operation fails, success: false is returned with an error message.


Example Usage

TypeScript
const = .(); const = .("example-content"); if (.) { .("HMAC:", .); } else { .("Error:", .); }

Notes

  • This function executes synchronously.
  • If the secretKey is improperly configured during initialization, it may throw a runtime error.
Last updated on