<?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 Re: library function to generate unique number for any string in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/library-function-to-generate-unique-number-for-any-string/m-p/2584367#M725622</link>
    <description>You want XrmStringToQuark from libX11.  (The manual does not mention it, but you should use&lt;BR /&gt;#include &lt;X11&gt;&lt;BR /&gt;to get the function declaration.)&lt;BR /&gt;&lt;BR /&gt;The function uses a hash table to implement the mapping.  It keeps a copy of each string to verify uniqueness.  You can get a string back with XrmQuarkToString.&lt;/X11&gt;</description>
    <pubDate>Tue, 25 Sep 2001 19:53:30 GMT</pubDate>
    <dc:creator>Mike Stroyan</dc:creator>
    <dc:date>2001-09-25T19:53:30Z</dc:date>
    <item>
      <title>library function to generate unique number for any string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/library-function-to-generate-unique-number-for-any-string/m-p/2584364#M725619</link>
      <description>Is there a library function to generate a unique number for any string that I get as input. Also, it should generate the same number if I pass the same string to it again and again !&lt;BR /&gt;&lt;BR /&gt;Can anybody help ?&lt;BR /&gt;&lt;BR /&gt;Thanks and regards&lt;BR /&gt;&lt;BR /&gt;Amit Kureel</description>
      <pubDate>Tue, 25 Sep 2001 08:42:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/library-function-to-generate-unique-number-for-any-string/m-p/2584364#M725619</guid>
      <dc:creator>Amit Kureel</dc:creator>
      <dc:date>2001-09-25T08:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: library function to generate unique number for any string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/library-function-to-generate-unique-number-for-any-string/m-p/2584365#M725620</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;i know no library function but how about this:&lt;BR /&gt;&lt;BR /&gt;int uniq(str)&lt;BR /&gt;char *str;&lt;BR /&gt;{&lt;BR /&gt;  int i,l,n;&lt;BR /&gt;  &lt;BR /&gt;  for(n=0,i=0,l=strlen(str);i&lt;L&gt;&lt;/L&gt;    n+=(int)str[i];&lt;BR /&gt;  return(n);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Sep 2001 08:57:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/library-function-to-generate-unique-number-for-any-string/m-p/2584365#M725620</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-09-25T08:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: library function to generate unique number for any string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/library-function-to-generate-unique-number-for-any-string/m-p/2584366#M725621</link>
      <description>Amit,&lt;BR /&gt;&lt;BR /&gt;I think this is not possible at all.&lt;BR /&gt;Any checksum-algorithm might produce the same number for same strings again, but it will never be unique, because due to truncation at a given point, two diffrent strings might return the same number!&lt;BR /&gt;&lt;BR /&gt;Try "man cksum" for a sample.&lt;BR /&gt;&lt;BR /&gt;You could write an algorithm if you limit the amount of characters user in the given string and the maximum length. But this would go closer to some kind of compression.&lt;BR /&gt;&lt;BR /&gt;I do not know, what you want to achieve, but I think the compression algorithms might be close to what you want. The problem is, that you will get a compressed string of a shorter length as a result, and not a simple number.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;Volker&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Sep 2001 09:27:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/library-function-to-generate-unique-number-for-any-string/m-p/2584366#M725621</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2001-09-25T09:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: library function to generate unique number for any string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/library-function-to-generate-unique-number-for-any-string/m-p/2584367#M725622</link>
      <description>You want XrmStringToQuark from libX11.  (The manual does not mention it, but you should use&lt;BR /&gt;#include &lt;X11&gt;&lt;BR /&gt;to get the function declaration.)&lt;BR /&gt;&lt;BR /&gt;The function uses a hash table to implement the mapping.  It keeps a copy of each string to verify uniqueness.  You can get a string back with XrmQuarkToString.&lt;/X11&gt;</description>
      <pubDate>Tue, 25 Sep 2001 19:53:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/library-function-to-generate-unique-number-for-any-string/m-p/2584367#M725622</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2001-09-25T19:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: library function to generate unique number for any string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/library-function-to-generate-unique-number-for-any-string/m-p/2584368#M725623</link>
      <description>Hello Amit,&lt;BR /&gt;&lt;BR /&gt;you could use UUID (DCE Universal Unique IDs) in one&lt;BR /&gt;way, an array to store them and the appropriate string&lt;BR /&gt;for the way back. UUIDs are 128bits in size, and the&lt;BR /&gt;creation of them is guaranteed to be unique...&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Wodisch</description>
      <pubDate>Fri, 05 Oct 2001 01:08:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/library-function-to-generate-unique-number-for-any-string/m-p/2584368#M725623</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2001-10-05T01:08:35Z</dc:date>
    </item>
  </channel>
</rss>

