Hash
Discover more about the Hash connector and how to use it on the Digibee Integration Platform.
The Hash connector allows you to generate hashed values from different types of input. Depending on your use case, you can choose to hash specific fields, files, or the entire payload.
Each option exposes its own set of parameters, but all configurations follow the same basic logic: you select the operation, define the hashing algorithm, and adjust additional parameters according to your needs.
Parameters
The configuration parameters are organized into tabs: General and Documentation.
The General tab contains all fields used to configure the connector. It includes parameters that are always visible, as well as those that appear dynamically depending on the selected Crypto Operation (for example,
Hash Fields,Hash File, orHash Payload) or Crypto Algorithm (for example,HmacSHA256orBCrypt).The Documentation tab provides an optional field where you can describe the connector configuration and add business rules or relevant notes.
Fields that support Double Braces expressions are marked in the Supports DB column.
Common parameters
These parameters are always displayed, regardless of the selected operation.
Alias
Name (alias) for this connector’s output, allowing you to reference it later in the flow using Double Braces expressions. Learn more.
String
❌
hash-1
Crypto Operation
Type of operation to be performed. Possible values: Hash Fields, Hash Payload, or Hash File.
Select
❌
Hash Fields
Crypto Algorithm
Type of algorithm used to generate the hash. Possible values: MD5, SHA-1, SHA-256, SHA-384, SHA-512, HmacSHA1, HmacSHA256, HmacSHA384, HmacSHA512, and BCrypt.
Select
❌
SHA-512
Result As Hexadecimal
If enabled, keeps the hash in hexadecimal format; otherwise, the format will be base64.
Boolean
❌
true
Fail On Error
If enabled, interrupts the pipeline execution when an error occurs. If disabled, execution continues, but the "success" property will be set to false.
Boolean
❌
false
Hash Fields
These parameters are displayed only when the Crypto Operation is set to Hash Fields.
JSON Field Path
JSON path of the string field in dotted notation.
String
✅
xml.text
Preserve Original
If enabled, preserves the original field as a "Field" property at the same level as the original one.
Boolean
❌
true
Hash File
These parameters are displayed only when the Crypto Operation is set to Hash File.
File Name
Name of the file or full file path (for example, tmp/processed/file.txt).
String
✅
N/A
Hash Payload
These parameters are displayed only when the Crypto Operation is set to Hash Payload.
Payload
Field to directly inform the payload that will be hashed.
String
✅
N/A
Algorithm-based configuration
These parameters depend on the selected Crypto Algorithm.
Account
Displayed only when Crypto Algorithm is one of HmacSHA1, HmacSHA256, HmacSHA384, or HmacSHA512. The account must be of the Secret Key type, and the key for the hash must be provided.
String
❌
N/A
Secret Key (DB)
Displayed only if no account is selected and the Crypto Algorithm is one of HmacSHA1, HmacSHA256, HmacSHA384, or HmacSHA512. Allows the connector to receive the key dynamically.
String
✅
N/A
Secret Key Type
Displayed only if no account is selected and the Crypto Algorithm is one of HmacSHA1, HmacSHA256, HmacSHA384, or HmacSHA512. Defines the type of key provided — String, Hexadecimal, or Base64.
Select
❌
Hexadecimal
Charset
Displayed only when the Secret Key Type is String. Defines the character encoding of the key.
String
❌
UTF-8
BCrypt Version
Displayed only when Crypto Algorithm is BCrypt. Defines the algorithm version to be used.
Select
❌
2y
Salt
Displayed only when Crypto Algorithm is BCrypt. A 16-byte string added to the hash value. If not informed, a random value is assumed.
String
✅
N/A
Cost Factor
Displayed only when Crypto Algorithm is BCrypt. Determines the number of hash rounds (2^n, where n is the cost factor, between 4 and 20).
Integer
❌
4
Documentation
Optional field to describe the connector configuration and any relevant business rules.
String
❌
N/A
Parameters additional information
Generated hash
The connector generates a hash from the string provided in the Payload field when the selected operation is Hash Payload.
If the selected operation is Hash Fields, the connector generates the hash from the string found in the fields specified in the input JSON.
Cost Factor
In the BCrypt algorithm, the cost factor exponentially increases the processing time and required resources. The algorithm is executed consecutively according to the number of rounds derived from the calculation 2ⁿ, where “n” is the cost factor.
The following examples illustrate how execution time can vary depending on the cost factor. The tests were performed using a 1 MB payload and the minimum and maximum allowed cost factor values for the BCrypt algorithm.
Cost Factor 4
Small pipeline: Average of 0.98s
Medium pipeline: Average of 0.64s
Large pipeline: Average of 0.07s
Cost Factor 20
Small pipeline: Average of 8m 7s
Medium pipeline: Average of 3m 56s
Large pipeline: Average of 1m 53s
These results may vary depending on the integration flow, message size, and cost factor applied.
The BCrypt cost factor can range from 4 to 31. However, values above 20 result in very high processing loads and execution times, often exceeding the pipeline timeout limits. For this reason, the Hash connector only accepts a maximum cost factor value of 20.
When using the BCrypt algorithm with the Hash connector, make sure to keep the cost factor within this limit to avoid validation or processing issues in your integration flow.
Message flow
Input
Operation: Hash Fields
When using the Hash Fields operation, the connector can receive any input message, but you must configure the JSON Field Path property to define where the hash will be applied. For example:
JSON Field Path: data.test
Payload:
{
"data":[
{"test":"xpto"},
{"test":"xpto1"},
{"test":"xpto2"},
{"test":"xpto3"}
]
}In this case, the connector searches for the test property inside the data property.
Operation: Hash Payload
When using the Hash Payload operation, the message to be hashed must be provided in the Payload field.
Operation: Hash Files
When using the Hash Files operation, the file name must be provided in the File Name field.
Output
Operation: Hash Fields
The output maintains the same structure as the input but includes the generated hash.
If the Preserve Original property is enabled, the output keeps the original field and adds a new one prefixed with an underscore (_):
Operation: Hash Payload
The output contains the result property with the hash of the provided message:
{
"result": "3851b1ae73ca0ca6e3c24a0256a80ace"
}Error example
{
"success": false,
"message": "Something went wrong while trying to use the HashConnector. Error: java.lang.StringIndexOutOfBoundsException: String index out of range: 1",
"error": "java.lang.StringIndexOutOfBoundsException: String index out of range: 1"
}success:false— indicates that an error occurred during execution.message: connector error message.error: detailed error message returned by the hash algorithm.
Operation: Hash Files
The output displays a result property containing the generated hash according to the selected algorithm.
Example using SHA-256:
{
"result": "aff746225015b78af3c3f0a7540b10c300d73b3b562cec75ef2df9cfbf7ae2b6"
}Hash in action
Operation: Hash Fields
Example 1
Crypto Operation:
Hash FieldsCrypto Algorithm:
SHA-256JSON Field Path:
data.testPreserve Original:
trueResult as Hexadecimal:
true
Input
{
"data": [
{"test":"xpto"},
{"test":"xpto1"},
{"test":"xpto2"},
{"test":"xpto3"}
]
}Output
Example 2
Crypto Operation:
Hash FieldsCrypto Algorithm:
HmacSHA256Account: (empty)
Secret Key:
001def0209Secret Key Type:
Hexadecimal(the value in the Secret Key field must be in hexadecimal format)JSON Field Path:
data.testPreserve Original:
trueResult as Hexadecimal:
true
Input
{
"data": [
{"test":"xpto"},
{"test":"xpto1"},
{"test":"xpto2"},
{"test":"xpto3"}
]
}Output
Example 3
Crypto Operation:
Hash FieldsCrypto Algorithm:
BCryptBCrypt Version:
2ySalt:
N9qo8uLOickgx2ZMCost:
6JSON Field Path:
data.testPreserve Original:
true
Input
{
"data": [
{"test":"xpto"},
{"test":"xpto1"},
{"test":"xpto2"},
{"test":"xpto3"}
]
}Output
Operation: Hash Payload
Example 1
Crypto Operation:
Hash PayloadCrypto Algorithm:
SHA-256Payload: (any payload)
Result as Hexadecimal:
true
Output
{
"result": "2e954593b0b51547656f7f06ec3818a2b42fed46307b81bd493133aa1ce45173"
}Example 2
Crypto Operation:
Hash PayloadCrypto Algorithm:
HmacSHA512Account: (empty)
Secret Key:
001def0209Secret Key Type:
HexadecimalPayload: (any payload)
Result as Hexadecimal:
true
Output
{
"result": "517da9449385a43478309459adf9304bd3c8f63cd1d388abd5cbc02b81d8ccb39d303f877019aebfed073166e6c410197e10077f6df3f7a3b3f50adb8cd09580"
}Example 3
Crypto Operation:
Hash PayloadCrypto Algorithm:
BCryptBCrypt Version:
2bSalt:
N9qo8uLOickgx2ZMCost:
10Payload:
{{ message.data }}
Input
{
"data": [
{"test":"xpto"},
{"test":"xpto1"},
{"test":"xpto2"},
{"test":"xpto3"}
]
}Output
{
"result": "$2b$10$RhjvZxfzRC7nW0rlcBHYROa3UXROXVeKZ3oK4DSc1mV6iJ/pBqBm6"
}Operation: Hash Files
When you select the Hash Files operation, the connector generates a hash from the file provided in the File Name field.
The file must have been previously passed in the pipeline, for example, through a File Writer connector.
Example
Crypto Operation:
Hash FileCrypto Algorithm:
SHA-256File Name:
{{ message.fileName }}(thedatais passed through the File Writer connector)Result as Hexadecimal:
true
Input
{
"data": "linha 1",
"fileName": "test"
}Output
{
"result": "aff746225015b78af3c3f0a7540b10c300d73b3b562cec75ef2df9cfbf7ae2b6"
}Last updated
Was this helpful?