hmac
Generates a hash-based message authentication code.
This function is restricted. Use of this function in your script will require a manual review before it will execute on the Sentinel infrastructure.
Signatures
beacon.hmac(algorithm, key, input);
Parameters
algorithm
One of md5
, sha1
, sha256
, sha-256
, sha2-256
, sha512
, sha-512
, sha2-512
, sha3-256
, or sha3-512
. Some of these values are duplicates intended to be easier to remember.
key
The raw key to use. Do not use an encoding.
input
The input value for the hashing algorithm.
Return Values
Type | Notes |
---|---|
String | The message signature, hex encoded. |
Examples
Generate a SHA256 hash of Hello World
const signature = beacon.hmac('sha256', 'Password', 'Hello World');
beacon.debugPrint(signature); // Outputs "25c8922af6ecd2eff0e67b107aca31f604b0cdf0ccc67379b007e315b07106a7"