Developer Documentation Library > Scripting > UNICOM Intelligence Function Library > Miscellaneous functions > Hash
 
Hash
Generate an encoded hash value. This might be required when communicating with web services from an interview script.
Syntax
Hash(Value, [Algorithm], [HexEncoding]) As String
Parameters
Value
Type: String
The text to be encoded.
Algorithm
Type: String
Optional. The hashing algorithm to use: SHA256 or SHA512.
HexEncoding
Type: Boolean
Optional. True generates a hex-encoded character string. False generates a Base64‑encoded character string. The default value is False.
(return)
Type: String
Returns the encoded hash string.
Example
Dim Result
Result = Hash ("/projects/end?rst=2&psid=aYA3xQ6gory1u7hdS5o9AQ**&_k=2000", , True)
Debug.Log("SHA256 Hex encoded: " + Result)

Result = Hash ("/projects/end?rst=2&psid=aYA3xQ6gory1u7hdS5o9AQ**&_k=2000")
Debug.Log("SHA256 Base64 encoded: " + Result)

Result = Hash ("/projects/end?rst=2&psid=aYA3xQ6gory1u7hdS5o9AQ**&_k=2000", "SHA512", True)
Debug.Log("SHA512 Hex encoded: " + Result)

Result = Hash ("/projects/end?rst=2&psid=aYA3xQ6gory1u7hdS5o9AQ**&_k=2000",
"SHA512")
Debug.Log("SHA512 Base64 encoded: " + Result)
See also
HashHMAC
Miscellaneous functions