hash

Generates a hash using from a variety of algorithms.

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.hash(algorithm, 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.

input

The input value for the hashing algorithm.

Return Values

Type Notes
String The hashed input, hex encoded.

Examples

Generate a SHA256 hash of Hello World

const hash = beacon.hash('sha256', 'Hello World');
beacon.debugPrint(hash); // Outputs "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e"

See Also