crypt.hmac
Computes a keyed message digest.
Syntax
Signature
crypt.hmac(Key: string, Data: string, Algorithm: string?) -> stringAliases
This function has no aliases.
Parameters
| Parameter | Type | Description |
|---|---|---|
Key | string | Raw HMAC key, up to 16 MiB. |
Data | string | Message bytes, up to 16 MiB. |
Algorithm | string? | Hash algorithm. Defaults to sha256. |
Returns
| Type | Description |
|---|---|
string | Base64-encoded HMAC digest. |
Notes
Algorithm defaults to sha256 and accepts the same names as crypt.hash.
Example
Luau
local Result = crypt.hmac("key", "hello")
print(Result)