[Possible Bug-Python2.3.2] MD5 module?
Tim Peters
tim.peters at gmail.com
Wed Oct 13 20:30:22 EDT 2004
[Jean-Guillaume Paradis]
> I've tried to use the md5 module of python 2.3.3, and the results of
> a hash do not concord with those of reference sites such as
> http://bfl.rctek.com/tools/?tool=hasher
>
> I call it using
>
> import md5
> m = md5.new()
> m.update("a")
> print m.hexdigest()
Basic rule: always say both what you got, and what you expected to
get. You didn't reveal either, so replying helpfully is tedious.
Here's what I get from your code above:
0cc175b9c0f1b6a831c399e269772661
It's hard to tell what the site you linked to gets, because its output
text box is too narrow to display its full result when I try it.
Viewing the *source* of the web page, it's trying to display this:
<input type="text" id="hash" value="0cc175b9c0f1b6a831c399e269772661"
readonly="readonly" />
So it's trying to display the same value for "a" as Python returned.
I hope you didn't type
"a"
in the web page's input box -- that is, I hope you didn't type the quotes in.
> I have not checked if the problem is the same on more recent version
> though
Sorry, you haven't said enough for anyone to guess what you think "the
problem" is. I don't see a problem.
More information about the Python-list
mailing list