Hash Modules
The Hash Transformer can be used to calculate a hash value.
Remarks
The Hash Module contains an encoder that receives Mule Messages from the Mule Project and calculates a hash value.
Hash Encode Module
The Hash Encode operation allows you to compute a hash using various algorithms. To use the Hash Module, simply select an Algorithm. The module will compute a hash over the data in the incoming message payload at runtime.
If using an HMAC algorithm, you will also need to set the Key property to the secret key for the hash computation.
To hex encode the hash value set EncodeHash to True.
File Example
Add a File Read connector in front of the Hash Encode Module and configure it to read a particular target file. Select an Algorithm for the Encode operation. That is all that is required to hash the file. The calculated hash is written to the message payload.
String Example
Add a Set Payload Transformer in front of the Hash Encode Module and set the message payload to a string. Select an Algorithm for the Encode operation. That is all that is required to hash the string. The calculated hash is written to the message payload.
Encoder Property List
The following is the full list of the properties of the encoder Module with short descriptions. Click on the links for further details.
Algorithm | The algorithm used to create the hash. |
EncodeHash | Whether the hash value is hex encoded. |
Key | The secret key for the hash algorithm. |
Other | Defines a set of configuration settings to be used by the transformer. |
RuntimeLicense | Specifies the component runtime license key. |
Config Settings
The following is a list of config settings for the Module with short descriptions. Click on the links for further details.
Algorithm Property (Hash Module)
The algorithm used to create the hash.
Data Type
Enumeration
Possible Values
SHA1 (0)
SHA224 (1)
SHA256 (2)
SHA384 (3)
SHA512 (4)
MD2 (5)
MD4 (6)
MD5 (7)
RIPEMD160 (8)
MD5SHA1 (9)
HMACMD5 (10)
HMACSHA1 (11)
HMACSHA224 (12)
HMACSHA256 (13)
HMACSHA384 (14)
HMACSHA512 (15)
HMACRIPEMD160 (16)
SHA3_224 (17)
SHA3_256 (18)
SHA3_384 (19)
SHA3_512 (20)
Default Value
2
Remarks
This property specifies the algorithm used to create the hash. Possible values are:
0 (haSHA1) | SHA1 |
1 (haSHA224) | SHA-224 |
2 (haSHA256 - default) | SHA-256 |
3 (haSHA384) | SHA-384 |
4 (haSHA512) | SHA-512 |
5 (haMD2) | MD2 |
6 (haMD4) | MD4 |
7 (haMD5) | MD5 |
8 (haRIPEMD160) | RIPEMD-160 |
9 (haMD5SHA1) | MD5SHA1 |
10 (haHMACMD5) | HMAC-MD5 |
11 (haHMACSHA1) | HMAC-SHA1 |
12 (haHMACSHA224) | HMAC-SHA224 |
13 (haHMACSHA256) | HMAC-SHA256 |
14 (haHMACSHA384) | HMAC-SHA384 |
15 (haHMACSHA512) | HMAC-SHA512 |
16 (haHMACRIPEMD160) | HMAC-RIPEMD-160 |
17 (haSHA3_224) | SHA-3-224 (originally known as Keccak) |
18 (haSHA3_256) | SHA-3-256 (originally known as Keccak) |
19 (haSHA3_384) | SHA-3-384 (originally known as Keccak) |
20 (haSHA3_512) | SHA-3-512 (originally known as Keccak) |
21 (haSHA512_224) | SHA-512/224 |
22 (haSHA512_256) | SHA-512/256 |
EncodeHash Property (Hash Module)
Whether the hash value is hex encoded.
Data Type
Boolean
Default Value
true
Remarks
This property specifies whether the computed hash value is hex encoded. When set to True (default) the connector will hex encoded the computed hash for easier use. Set this value to False to obtain the hash value in an unmodified form.
The default value is True.
Key Property (Hash Module)
The secret key for the hash algorithm.
Data Type
String
Default Value
""
Remarks
This property holds the secret key used when creating the hash. The key can be arbitrarily long.
Note: This property is only applicable when Algorithm is set to an HMAC algorithm.
Other Property (Hash Module)
Defines a set of configuration settings to be used by the transformer.
Data Type
String
Default Value
""
Remarks
The module accepts one or more configuration settings. These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the module, access to these internal properties is provided through the Other property.
The Other property may be set to one or more configuration settings (name/value pairs). Set one setting per line.
For example:
configname1=value1
configname2=value2
RuntimeLicense Property (Hash Module)
Specifies the component runtime license key.
Data Type
String
Default Value
""
Remarks
You can use the RuntimeLicense property to set the runtime key for the connector license.