Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #16595

Re: order independent hash?

From Gelonida N <gelonida@gmail.com>
Subject Re: order independent hash?
Date 2011-12-03 21:26 +0100
References <jb57p7$b1j$1@dough.gmane.org> <jb7ldj$s8v$2@dough.gmane.org> <jb810q$j88$1@dough.gmane.org> <4ED91B70.1080804@davea.name>
Newsgroups comp.lang.python
Message-ID <mailman.3253.1322944000.27778.python-list@python.org> (permalink)

Show all headers | View raw


On 12/02/2011 07:39 PM, Dave Angel wrote:
> On 12/01/2011 08:55 AM, Neal Becker wrote:
>> Gelonida N wrote:
>>
>>> On 11/30/2011 01:32 PM, Neal Becker wrote:
>>>> I like to hash a list of words (actually, the command line args of my
>>>> program) in such a way that different words will create different
>>>> hash, but
>>>> not sensitive
>>>> to the order of the words.  Any ideas?
>>>>
>>> Do youmean hash like digest like md5sum / sha1 ?
>>>
>>>
>>> You should sort the words alphabetically, concatenate them with a space
>>> or any character, that will NEVER be part of a word and calulate the
>>> hash.
>>>
>>> If words can exist multiple times, then youhad tu uniqufy them (u using
>>> a python dict / set) first.
>> Yes that sounds just like what I wanted - thanks!
>>
You're welcome.

is it working as expected?

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: order independent hash? Gelonida N <gelonida@gmail.com> - 2011-12-03 21:26 +0100

csiph-web