<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic md5 calculation in route in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/md5-calculation-in-route/m-p/2341568#M109510</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an easy way to calculate a hash-key in a route? I know there is a component in jobs to do that, but I don't want to use a job in my route.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working with messages from a queue (ActiveMQ), so there will be all kinds of structures of messages to calculate a hash for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to have a route like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input JMS -&amp;gt; Hash calculation of message body -&amp;gt; Output JMS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this is possible and I'm looking forward to read the possibilities.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 21:52:44 GMT</pubDate>
    <dc:creator>Nreimondo1645519314</dc:creator>
    <dc:date>2024-11-15T21:52:44Z</dc:date>
    <item>
      <title>md5 calculation in route</title>
      <link>https://community.qlik.com/t5/Talend-Studio/md5-calculation-in-route/m-p/2341568#M109510</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an easy way to calculate a hash-key in a route? I know there is a component in jobs to do that, but I don't want to use a job in my route.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working with messages from a queue (ActiveMQ), so there will be all kinds of structures of messages to calculate a hash for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to have a route like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input JMS -&amp;gt; Hash calculation of message body -&amp;gt; Output JMS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this is possible and I'm looking forward to read the possibilities.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:52:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/md5-calculation-in-route/m-p/2341568#M109510</guid>
      <dc:creator>Nreimondo1645519314</dc:creator>
      <dc:date>2024-11-15T21:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: md5 calculation in route</title>
      <link>https://community.qlik.com/t5/Talend-Studio/md5-calculation-in-route/m-p/2341569#M109511</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;You are able to create a custom bean with the hashing code and just call it in your route.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;package beans;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import java.io.IOException;&lt;/P&gt;&lt;P&gt;import java.io.InputStream;&lt;/P&gt;&lt;P&gt;import java.security.DigestInputStream;&lt;/P&gt;&lt;P&gt;import java.security.MessageDigest;&lt;/P&gt;&lt;P&gt;import java.security.NoSuchAlgorithmException;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/**&lt;/P&gt;&lt;P&gt; * Generates a hash value based on the provided inputStream.&lt;/P&gt;&lt;P&gt; * &lt;/P&gt;&lt;P&gt; * For example returns a sha-256 hash of a file stream.&lt;/P&gt;&lt;P&gt; *&lt;/P&gt;&lt;P&gt; */&lt;/P&gt;&lt;P&gt;public class HashGenerator {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;	public static String DEFAULT_HASH_ALGORYTHM = "SHA-256";&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;	protected String hashAlgo;&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;	public HashGenerator(String hashAlgorithm) throws NoSuchAlgorithmException {&lt;/P&gt;&lt;P&gt;		this.hashAlgo = hashAlgorithm;&lt;/P&gt;&lt;P&gt;		// Test if algorithm exists&lt;/P&gt;&lt;P&gt;		MessageDigest.getInstance(hashAlgo);&lt;/P&gt;&lt;P&gt;	}&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;	public HashGenerator() throws NoSuchAlgorithmException {&lt;/P&gt;&lt;P&gt;		this(DEFAULT_HASH_ALGORYTHM);&lt;/P&gt;&lt;P&gt;	}&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;	public String checksum(InputStream stream) throws IOException, NoSuchAlgorithmException {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;		if (stream == null) {&lt;/P&gt;&lt;P&gt;			return null;&lt;/P&gt;&lt;P&gt;		}&lt;/P&gt;&lt;P&gt;		&lt;/P&gt;&lt;P&gt;		MessageDigest md = MessageDigest.getInstance(hashAlgo);&lt;/P&gt;&lt;P&gt;		&lt;/P&gt;&lt;P&gt;        // file hashing with DigestInputStream&lt;/P&gt;&lt;P&gt;        try (DigestInputStream dis = new DigestInputStream(stream, md)) {&lt;/P&gt;&lt;P&gt;            while (dis.read() != -1) ; //empty loop to clear the data&lt;/P&gt;&lt;P&gt;        	md = dis.getMessageDigest();&lt;/P&gt;&lt;P&gt;            dis.close();&lt;/P&gt;&lt;P&gt;        }&lt;/P&gt;&lt;P&gt;		stream.close();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;        // bytes to hex&lt;/P&gt;&lt;P&gt;        StringBuilder result = new StringBuilder();&lt;/P&gt;&lt;P&gt;        for (byte b : md.digest()) {&lt;/P&gt;&lt;P&gt;            result.append(String.format("%02x", b));&lt;/P&gt;&lt;P&gt;        }&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;        return result.toString();&lt;/P&gt;&lt;P&gt;    }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000fL9cyAAC.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128875i1DCAAF9E173BFD66/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000fL9cyAAC.png" alt="0695b00000fL9cyAAC.png" /&gt;&lt;/span&gt;Feel free to let us know if it is what you are looking for.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Sabrina&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 10:45:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/md5-calculation-in-route/m-p/2341569#M109511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-26T10:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: md5 calculation in route</title>
      <link>https://community.qlik.com/t5/Talend-Studio/md5-calculation-in-route/m-p/2341570#M109512</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for replying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I fixed it using function DigestUtils.sha256Hex() in a cProcessor component.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 14:56:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/md5-calculation-in-route/m-p/2341570#M109512</guid>
      <dc:creator>Nreimondo1645519314</dc:creator>
      <dc:date>2023-04-26T14:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: md5 calculation in route</title>
      <link>https://community.qlik.com/t5/Talend-Studio/md5-calculation-in-route/m-p/2341571#M109513</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for sharing your solution with us and feel free to let us know if there is any further help we can give.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 06:09:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/md5-calculation-in-route/m-p/2341571#M109513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-27T06:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: md5 calculation in route</title>
      <link>https://community.qlik.com/t5/Talend-Studio/md5-calculation-in-route/m-p/2466794#M140894</link>
      <description>&lt;P&gt;Using the Hashify API would also be an option I guess.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 10:00:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/md5-calculation-in-route/m-p/2466794#M140894</guid>
      <dc:creator>SterreKapteijns</dc:creator>
      <dc:date>2024-07-01T10:00:31Z</dc:date>
    </item>
  </channel>
</rss>

