[Possible Bug-Python2.3.2] MD5 module?
jepler at unpythonic.net
Thu Oct 14 02:31:45 CEST 2004
It works fine here. When you use some other program to find the md5sum
of a file, does it have a trailing newline? Your example code doesn't.
[jepler at sofa jepler]$ printf a | md5sum
>>> import md5
>>> m = md5.new()
>>> print m.hexdigest()
If the string you want to find the md5sum of has a newline, you'll get a
different hash value:
>>> m = md5.new(); m.update("a\n"); print m.hexdigest()
$ echo a | md5sum
If you are working with files on windows, be sure to open them with the
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: not available
More information about the Python-list