Calculate Hash
Verb: hashCalculate
Available from: <Standard>
Calculates the hash code of a text or file based on a hash function.
A hash function is an algorithm that maps variable length data to fixed length data.
Syntax
hashCalculate [--isfromfile(Boolean)] --filename(String) --text(String) [--type(HashType)] (String)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--isfromfile | Use File | Optional | Boolean | When enabled, allows using the File parameter, therefore allowing entering a file as input. |
--filename | File | Only whenUse File is True | Text | Full path of the text file used to calculate hash code. |
--text | Text | Only whenUse File is False | Text | Text used to calculate hash code. |
--type | Hash Function | Optional | HashType | Hash function options used for hash code calculation:
|
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Hash code | Text | Returns the hash code calculated at File or Text. |
Example
The Calculate Hash command is used to calculate and returns the hash code of the text "IBM Robotic Process Automation".
defVar --name textHash --type String
// Calculate the hash of the text "IBM".
hashCalculate --text "IBM" --type "MD5" textHash=value
logMessage --message "${textHash}\r\n" --type "Info"
// This example produces the following result:
// "3d6fb8586714efefcbee019a276d2a2b"