crypt.hmac
HMAC. Default algorithm: sha256.
Syntax
crypt.hmac(key: string, data: string, algorithm?: string) -> string
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The key or secret used by the operation. |
data | string | The data payload to process or send. |
algorithm? | string | The hashing algorithm name. |
Returns
| Type | Description |
|---|---|
string | The returned string. |
Description
crypt.hmac is part of the Crypt library. Crypt functions process data locally. Keys, hashes and encrypted buffers remain inside the process.
The operation is performed immediately using the arguments supplied at the call site.
Example
print(crypt.hmac("key", "hello", "sha256"))
Notes
- Never log keys or decrypted buffers in production scripts.