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


Groups > comp.lang.python > #16430 > unrolled thread

Re: order independent hash?

Started byTim Golden <mail@timgolden.me.uk>
First post2011-11-30 12:38 +0000
Last post2011-11-30 12:38 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: order independent hash? Tim Golden <mail@timgolden.me.uk> - 2011-11-30 12:38 +0000

#16430 — Re: order independent hash?

FromTim Golden <mail@timgolden.me.uk>
Date2011-11-30 12:38 +0000
SubjectRe: order independent hash?
Message-ID<mailman.3155.1322656704.27778.python-list@python.org>
On 30/11/2011 12:32, 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?

How about?

   hash (frozenset ("hello world".split ()))

TJG

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web