Windows XP, Python 2.5:
hash('http://stackoverflow.com') Result: 1934711907
Google App Engine (http://shell.appspot.com/):
hash('http://stackoverflow.com') Result: -5768830964305142685
Why is that? How can I have a hash function that will give me same results across different platforms (Windows, Linux, Mac)?
Use hashlib as
hash()was designed to be used to:and therefore does not guarantee that it will be the same across Python implementations.