<?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 Randomised hash-function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Randomised-hash-function/m-p/2474167#M99990</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;I am currently working on a project where I need to hash a certain field with values of usernames. The project is only for internal use. Thus I use the hash128()-function in the script.&lt;/P&gt;
&lt;P&gt;Although the usernames need to be hashed, it is also reuqiered to access the unhashed values from time to time. This will be done manually by reloading the app once without the hash-function and then hash the field again.&lt;/P&gt;
&lt;P&gt;The challenge is that if I hash the usernames, then unhash them and hash them again, the "second hashed values" are excactly the same as the ones before.&lt;/P&gt;
&lt;P&gt;This means for example the username "Mike" will be "XYZ" when hashed the first time, unhashed it will be "Mike" again and then after reloading it with hash(usernames) it is "XYZ" again.&lt;/P&gt;
&lt;P&gt;Is there any way to randomise the hash function every time when reloading the app?&lt;/P&gt;
&lt;P&gt;I tried hash128(username, rand()) but that doesn't work properly. It leads to random values for every single time "Mike" is part of the data.&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Thu, 01 Aug 2024 13:04:39 GMT</pubDate>
    <dc:creator>dspvs</dc:creator>
    <dc:date>2024-08-01T13:04:39Z</dc:date>
    <item>
      <title>Randomised hash-function</title>
      <link>https://community.qlik.com/t5/App-Development/Randomised-hash-function/m-p/2474167#M99990</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;I am currently working on a project where I need to hash a certain field with values of usernames. The project is only for internal use. Thus I use the hash128()-function in the script.&lt;/P&gt;
&lt;P&gt;Although the usernames need to be hashed, it is also reuqiered to access the unhashed values from time to time. This will be done manually by reloading the app once without the hash-function and then hash the field again.&lt;/P&gt;
&lt;P&gt;The challenge is that if I hash the usernames, then unhash them and hash them again, the "second hashed values" are excactly the same as the ones before.&lt;/P&gt;
&lt;P&gt;This means for example the username "Mike" will be "XYZ" when hashed the first time, unhashed it will be "Mike" again and then after reloading it with hash(usernames) it is "XYZ" again.&lt;/P&gt;
&lt;P&gt;Is there any way to randomise the hash function every time when reloading the app?&lt;/P&gt;
&lt;P&gt;I tried hash128(username, rand()) but that doesn't work properly. It leads to random values for every single time "Mike" is part of the data.&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 13:04:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Randomised-hash-function/m-p/2474167#M99990</guid>
      <dc:creator>dspvs</dc:creator>
      <dc:date>2024-08-01T13:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Randomised hash-function</title>
      <link>https://community.qlik.com/t5/App-Development/Randomised-hash-function/m-p/2474179#M99997</link>
      <description>&lt;P&gt;&lt;EM&gt;By design, a hash function can not be reversed.&lt;BR /&gt;&lt;BR /&gt;you could use something that change character with special character and&amp;nbsp;mix it in a reversible way&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 13:53:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Randomised-hash-function/m-p/2474179#M99997</guid>
      <dc:creator>david990</dc:creator>
      <dc:date>2024-08-01T13:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Randomised hash-function</title>
      <link>https://community.qlik.com/t5/App-Development/Randomised-hash-function/m-p/2474205#M100004</link>
      <description>&lt;P&gt;I think you are on the right track with rand(), you just need to use something that is unique per script run but constant for the duration of the run. How about&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="courier new,courier"&gt;LET vNow = Num(Now());&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LOAD&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;hash128(username, $(vNow))&amp;nbsp;as Hashed&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;...&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;-Rob&lt;BR /&gt;&lt;A href="http://www.easyqlik.com" target="_blank"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://masterssummit.com" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://qlikviewcookbook.com" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 16:20:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Randomised-hash-function/m-p/2474205#M100004</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2024-08-01T16:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Randomised hash-function</title>
      <link>https://community.qlik.com/t5/App-Development/Randomised-hash-function/m-p/2475347#M100126</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6148"&gt;@rwunderlich&lt;/a&gt; Thanks a lot - the solution with a separate variable works fine!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 13:42:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Randomised-hash-function/m-p/2475347#M100126</guid>
      <dc:creator>dspvs</dc:creator>
      <dc:date>2024-08-08T13:42:12Z</dc:date>
    </item>
  </channel>
</rss>

