- 16 Feb 2023
- 3 Minutes to read
-
DarkLight
Utilities
- Updated on 16 Feb 2023
- 3 Minutes to read
-
DarkLight
Utility steps enable you to perform common actions to manipulate workflow data. These include extracting, parsing, validating, calculating, and many more. Utilities are not vendor based.
Array utils
Here's a list of supported array utilities. To learn more, check out examples for each one.
Utility name | Description |
---|---|
Append to array | Adds an object to the end of an existing array or instantiates (creates) an array to which objects will later be added. |
Chunk array | Divides an existing array into smaller arrays. |
Concat arrays | Combines two arrays into a single array. Objects that appear in both arrays are duplicated in the concatenated result. |
Extract field from records | Given a list of records and a field name, extract the value for the provided field name for each record. |
Filter array | Filters an array to produce a subset of the data. The result is based on the Filter func parameter. |
Get last item of array | Returns the last object in the provided array. |
Join strings | Returns a single string of all objects in the provided array, separated by the given delimiter. |
Prepend to array | Adds an object to the beginning of an existing array or instantiates (creates) an array to which objects can be added later. |
Reverse array | Reverses the order of the items in a provided array. |
Rollup numeric array | Performs a rollup function on an array of numbers. |
Slice array | Returns a slice (section) of the provided array. |
Slice array from start | Returns a slice (section) of the provided array from the first object in the array up to the specific index. |
Slice array to end | Returns a slice (section) of the provided array from the first provided index and up to and including the last object. |
Sort array | Sort the objects in the provided array. Supports strings, numbers, and datetime strings. |
Subtract arrays | Compares two arrays (left and right) to receive 3 sub-arrays. |
Unique on array | Returns an array in which each input array member appears only once. |
Cryptographic utils
Here's a list of supported cryptographic utilities. To learn more, check out examples for each one.
Utility name | Description |
---|---|
Calculate MD5 | Calculates the MD5 hash of the provided file. |
Calculate SHA1 | Calculates the SHA1 hash of the provided file. |
Calculate SHA256 | Calculates the SHA256 hash of the provided file. |
Cipher decrypt | Uses cipher to decrypt the provided text. |
Cipher encrypt | Uses cipher to encrypt the provided text. |
Decode JWT | Decodes the provided JSON Web Token without its signature. |
Encode JWT | Uses HS256 to encode a JSON Web Token. Default claims are iat (issue time) and exp (expiration time). |
Generate random number | Generates a random number within the minimum and maximum values. |
Generate random string | Generates a random alphanumeric string. |
Generate UUID | Generates a UUID (universally unique identifier) string. |
Get TLS certificate information | Returns information about TLS/SSL certificates for the provided endpoint. |
Date and time utils
Here's a list of supported date and time utilities. To learn more, check out examples for each one.
Utility name | Description |
---|---|
Calculate time and duration | Calculates and returns the duration (absolute) from the provided date and time to/from the present moment. |
Convert date | Converts the provided date to the specified new date format. |
Get date | Returns a time and date string according to the provided format, time offset, timezone, and date. |
Encoding utils
Here's a list of supported encoding utilities. To learn more, check out examples for each one.
Utility name | Description |
---|---|
Convert CSV to JSON | Converts and outputs the provided CSV file to JSON format. |
Convert EML to JSON | Converts and outputs the provided EML file to JSON format. |
Convert JSON to YAML | Converts and outputs the provided JSON file to YAML format. |
Decode base64 | Decodes the provided base64 string. |
Decode hex | Decodes the provided Hex string. |
Decode JSON | Decodes and outputs the provided JSON string to a JSON object. |
Decode URL | Decodes the provided URL. |
Encode base64 | Encodes the provided text in base64. |
Encode hex | Encodes the provided text into Hex. |
Encode URL | Encodes the provided URL to URL encoded format. |
String utils
Here's a list of supported string utilities. To learn more, check out examples for each one.
Utility name | Description |
---|---|
Convert string to lowercase | Converts and outputs all characters in the provided text to lowercase. |
Convert string to title case | Converts and outputs all characters in the provided text to title case. |
Convert string to uppercase | Converts and outputs all characters in the provided text to uppercase. |
Defang or refang entity | Defangs or refangs the provided IP, URL, or email address. |
Escape JSON string | Escapes the provided text so you can use it in JSON. |
Replace substring in text | Replaces one substring with another one in the provided text. |
Split text | Splits the provided text according to the given separator. |
Trim spaces before and after string | Trims (removes) the spaces at the beginning and the end of the provided text. |
Trim string characters | Trims (removes) all occurrences of the given characters from one or two edges of the provided text. |
Trim string prefix | Trims (removes) the prefix of the provided text. |
Trim string suffix | Trims (removes) the suffix of the provided text. |
Truncate text | Truncates (shortens) the provided text to the given limit. |