hash()

Fredrik Lundh fredrik at pythonware.com
Mon Dec 5 14:08:46 EST 2005


John Marshall wrote:

> For strings of > 1 character, what are the chances
> that hash(st) and hash(st[::-1]) would return the
> same value?

the algorithm is described here:

    http://effbot.org/zone/python-hash.htm

feel free to do a mathematical analysis.  a non-mathematical analysis
says that if the chance is high if your word is a palindrome, and low if
it's not.

</F>






More information about the Python-list mailing list