hash() algorithm

Paul Rubin http
Thu Jul 22 09:33:12 CEST 2004

Benoît Dejean <bnet at ifrance.com> writes:
> hi. Is the hash() algorithm standard ? Does hash(some_string) will always
> return the same hash code on every arch ?

I'd say you should not rely on that.

> i need to use a ~checksum function, like md5, but i was also
> thinking about hash() which is obviously simpler. So i can safely
> rely on hash() behaviour so i can use it to generate ~strong and
> portable identifier/checksum ?

I don't know what you mean by "strong".  I'm sure you can find collisions
in hash() without much effort.  It's much harder to do that for md5.

More information about the Python-list mailing list