0

Does anyone know the Mule 4 equivalent to the following Mule 3 code?

 <expression-component doc:name="TECH_Heroku_PartKey"><![CDATA[
   payload=com.google.common.hash.Hashing.sha1().hashBytes(payload.getBytes("UTF-8"));
 ]]></expression-component>

1 Answer 1

0

The hashWith() can be used in DataWeave 2 to generate a hash with different algorithm, including SHA1.

You need to be mindful that the result may vary depending on what the payload is. I'm guessing that in Mule 3 you are converting a Java string into bytes. In Mule 4 the hashWith() function expects a binary. You will to test it.

Alternatively you could put the same code in a Java method and call it using the Java Module.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.