"Arash Partow" <[EMAIL PROTECTED]> writes:
> I've ported various hash functions to python if anyone is interested:

Are these useful for any particular interoperability purposes?
Otherwise I'd say just one such hash is plenty, or maybe don't even
bother, since Python's built-in dicts are sufficient for most
applications that call for hashing, and the cryptographic hashes are
available for when you really care about uniformity of the hash
output.

>     for i in range(len(key)):
>       hash = hash * a + ord(key[i])
>       a = a * b

As a stylistic issue, I'd write this:

  for c in key:
     hash = hash * a + ord(c)
     a *= b

and similarly for the other similar loops.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to