order independent hash?

Ian Kelly ian.g.kelly at gmail.com
Fri Dec 2 13:37:26 EST 2011


On Fri, Dec 2, 2011 at 11:18 AM, 88888 Dihedral
<dihedral88888 at googlemail.com> wrote:
> On Wednesday, November 30, 2011 8:32:39 PM UTC+8, 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?
>
> For each word of your list as the key, an object of a hash can be used further
> is stored as the value in the hash of the list of words.
>
> Assume that word 1 is the key and the hash stored is a sentence that uses
> the key word 1.
>
> This is very useful to learn vocabularies and writing sentences.

The OP is talking about hash functions, not hash tables, and
furthermore he is talking about hashing the entire unordered
collection of words, not hashing individual words or ordered
sentences.



More information about the Python-list mailing list