Yuari
Documentation
Docs/Crypt/crypt.hmac

crypt.hmac

HMAC. Default algorithm: sha256.

Syntax

crypt.hmac(key: string, data: string, algorithm?: string) -> string

Parameters

ParameterTypeDescription
keystringThe key or secret used by the operation.
datastringThe data payload to process or send.
algorithm?stringThe hashing algorithm name.

Returns

TypeDescription
stringThe 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.