md5 consistent across platforms/Python versions?

Fredrik Lundh fredrik at pythonware.com
Tue Jul 15 17:47:49 CEST 2003


Tim Peters wrote:

> > Can someone tell me whether an MD5 hash using Python's MD5 library IS
> > guaranteed to return the same results for the same input string,
> > across platforms and Python versions?
>
> Yes, it's the same, and the same as what you'll get from any other correct
> program for computing an MD5 digest from that string.

historical footnote: if you dig up really old Python versions, the MD5
calculation was broken on 64-bit platforms (the code assumed that a
long was always 32 bits)

this was fixed in 1996:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Modules/md5.h.diff?r1=2.2&r2=2.3

</F>








More information about the Python-list mailing list