Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Example
In this example, we are passing the required parameters to the function transformation object using a Variables object.
Where,
str = Hello World!
Right-click on the function transformation object and select Preview Output. You can see that Astera has returned a fixed-size, 256-bit (32-byte) hexadecimal hashed value of the specified string.
Example
In this example, we are passing the required parameters to the function transformation object using a Variables object and a ToByte object.
Where,
bytes = value
Note: The Value is the output value (bytes) from the ToBytes function transformation object, where a string value, “Hello World”, has been converted into a byte array.
codepage = 65001 (UTF-8 - Default)
Right-click on the FromBytes function transformation object and select Preview Output. You can see that Astera has returned a string value after successfully converting the provided byte array.
Example
In this example, we are passing the required parameters to the function transformation object using a Variables object.
Where,
str = Hello World!
Right-click on the function transformation object and select Preview Output. You can see that Astera has returned the MD5 hashed value, a 128-bit (16-byte) hexadecimal number, typically represented as a 32-character string of the specified string.
Name
ComputeSHA256
Syntax
ComputeSHA256 (String str)
Purpose
To compute the SHA-256 hash of a text value.
Description
Returns a SHA-256 (Secure Hash Algorithm 256-bit (32-byte) hexadecimal value) representation of a given string.
Return Type
String
Parameter
str [System.String] – The raw string to use as the input
Name | FromBytes |
Syntax | FromBytes (ByteArray bytes. String codePage) |
Purpose | To return a string by reading a byte array in a specified encoding. |
Description | Returns a string after it has been converted from a byte array. |
Return Type | String |
Parameters | bytes [System.Byte[]] – The raw byte array containing a textual value. codepage [System.String] – The code page the byte array is currently encoded in. Default is UTF-8. |
Name | ComputeMD5 |
Syntax | ComputeMD5 (String str) |
Purpose | To compute the MD5 hash of a text value. |
Description | Returns MD5 hash (Message Digest Algorithm 5 – 128-bit (16-byte) hexadecimal value), of the input string. |
Return Type | String |
Parameter | str [System.String] – The raw string to HASH |
Example
In this example, we are passing the required parameters to the function transformation object using a Variables object.
Where,
str = http://www.helloWorld.com/ABC-123/ABC123
Right-click on the function transformation object and select Preview Output. You can see that Astera has returned the escaped URL value.
Example
In this example, we are passing the required parameters to the function transformation object using a Variables object.
Where,
str = Hello World
codepage = UTF-8 (Default)
Right-click on the function transformation object and select Preview Output. You can see that Astera has returned the byte value of the specified UTF-8 string.
Example
In this example, we are passing the required parameters to the function transformation object using a Variables object.
Where,
str = Hello World!
key = 0x95A1F27B384C3B50
Note: Random keys can be used for generating unique hashes, such as in hash tables.
Right-click on the function transformation object and select Preview Output. You can see that Astera has returned the hashed value of the specified string, using the specified key value.
Example
In this example, we are passing the required parameters to the function transformation object using a Variables object.
Where,
str = Helloαβ
fromCodePage = 65001 (UTF-8 - Default)
toCodePage = 20127 (US - ASCII)
Right-click on the function transformation object and select Preview Output. You can see that Astera has returned a string in the Output. This means that the provided string’s encoding has been successfully converted
Name
UrlEncode
Syntax
UrlEncode (String str)
Purpose
To return an escaped string.
Description
Returns a string by replacing invalid characters with valid ones for use in a URL.
Return Type
String
Parameter
str [System.String] – The raw string to encode
Name
ToBytes
Syntax
ToBytes (String str, String codePage)
Purpose
To return a byte array in the given encoding.
Description
Returns and array of bytes. Good as an intermediate structure to be used with other functions.
Return Type
Byte
Parameters
str [System.String] – The string to convert
codepage [System.String] – The code page that string is currently encoded in. Default is UTF-8.
Name
ComputeHash
Syntax
ComputeHash (String str, String key)
Purpose
To return a hashed representation of a given string using a specified key.
Description
Returns (A base 64 encoded value) a hashed representation of a given string using a key.
Return Type
String
Parameters
str [System.String] – The raw string to use as the input
key [System.String] – The secret random key used to compute the hash
Name
ConvertEncoding
Syntax
ConvertEncoding (String str, String fromCodePage, String toCodePage)
Purpose
To return a string in the given encoding.
Description
Returns a string in the specified encoding, codepage value.
Return Type
String
Parameters
Str [System.String] – The string to convert
fromCodePage [System.String] – The code page the string is currently encoded in. Default is UTF-8
toCodePage [System.String] – The code page to convert to. Default is UTF-8
Example
In this example, we are passing the required parameters to the function transformation object using a Variables object.
Where,
str = http%3A%2F%2Fwww.helloWorld.com%2FABC-123%2FABC123
Right-click on the function transformation object and select Preview Output. You can see that Astera has returned the resolved URL value.
Name
UrlDecode
Syntax
UrlDecode (String str)
Purpose
To return an unescaped string from a URL.
Description
Returns a string by replacing escaped characters with resolved ones from a URL.
Return Type
String
Parameter
str [System.String] – The escaped string to decode
Example
In this example, we are passing the required parameters to the function transformation object using a Variables object.
Where,
str = Hello World!
key = 0x95A1F27B384C3B50
Note: Random keys can be used for generating unique hashes, such as in hash tables.
hex = True
Right-click on the function transformation object and select Preview Output. You can see that the tool has returned the hexadecimal hashed value of the specified string, using the specified key value.
Similarly, the following will be the output if the hex value is specified as “False”:
Name
ComputeHash
Syntax
ComputeHash (String str, String key, Boolean hex)
Purpose
To return a hashed representation of a given string using a specified key.
Description
Returns (A base 64 encoded value or a string representation of the value – If hex value is ‘True’) a hashed representation of a given string using a key.
Return Type
String
Parameters
str [System.String] – The raw string to use as the input
key [System.String] – The secret random key used to compute the hash
hex [System.Boolean] – Used to specify whether the resulting hash should be represented in hexadecimal format (True) or as raw binary data (False)