473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

[Possible Bug-Python2.3.2] MD5 module?

Hi,

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()
I have not checked if the problem is the same on more recent version
though


Jul 18 '05 #1
2 1490
Jean-Guillaume Paradis wrote:
Hi,

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()
I have not checked if the problem is the same on more recent version
though


Try again. The two examples you cite, though you for some reason
didn't bother showing your actual output, both produce the same
result for me, namely:
import md5
m = md5.new()
m.update('a')
print m.hexdigest()

0cc175b9c0f1b6a831c399e269772661
And from the source for the rctek.com web page mentioned above, aftering
entering "a" in the box:

<label for="string">Enter a string to hash:
<input type="text" id="string" name="string" value="a" /></label>
<input type="submit" value="Submit" class="submit" />
<label for="hash">Hash of string:
<input type="text" id="hash" value="0cc175b9c0f1b6a831c399e269772661"
readonly="readonly" /></label>
-Peter
Jul 18 '05 #2
On Wed, 13 Oct 2004 19:07:43 -0400, Jean-Guillaume Paradis <je********************@usherbrooke.ca> wrote:
Hi,

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()
I have not checked if the problem is the same on more recent version
though

Why don't you show the result that you think is wrong instead of making useless
work for anyone interested?

Here is what I get:
import md5
m = md5.new()
m.update("a")
print m.hexdigest() 0cc175b9c0f1b6a831c399e269772661

Now if you do the same with your reference implementation, we can get somewhere ;-)
BTW, I seem to have the same version as you (if you are on windows):
import sys
sys.version

'2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)]'

Regards,
Bengt Richter
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

39
by: Mark Johnson | last post by:
It doesn't seem possible. But would the following also seem a violation of the general notions behind css? You have a DIV, say asociated with class, 'topdiv'. Inside of that you have an anchor...
1
by: news.microsoft.com | last post by:
Hello group, My goal is to attach an image over another image. Top image should be transparent so the back image is visible through the top one. Bellow is a test code in VB.NET. You need to...
11
by: Rob Williscroft | last post by:
I have the following code , part of a trait to detect wether a type has a member operator "Type" (), it works fine with g++ 3.4 (msvc compiles it but it doesn't work for template'd operator T ())...
12
by: Martin_Hurst | last post by:
Has some one come up with a similar type script that could be used in a Postgresql database? The script below was created for a SQLServer database. Thx, -Martin ...
5
by: Chris Ochs | last post by:
It doesn't currently seem possible to switch between different users using SET SESSION AUTHORIZATION. If I log in as the superuser and switch to another user that works, but if I then switch to a...
11
by: vbgunz | last post by:
Hello all, I am just learning Python and have come across something I feel might be a bug. Please enlightenment me... The following code presents a challenge. How in the world do you provide an...
4
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
7
by: Yuanfei | last post by:
Hi There, I just found that there is a problem in vc2005 regarding to time_t and localtime. See code snippets belows. Using this code segment, I found that when ut is 86200, the corresponding...
1
by: chencongwei | last post by:
Hi! This is what happened to me and my colleagues. We are using SQL 2005. When we were building a view from a table, the field we selected was not what came out in the output. Let's say you...
8
by: ThunderMusic | last post by:
Hi, We need to serialize (binary) objects containing generic collections. The thing is, when we try to get the objects back (deserialize) with a different instance of the application, we receive...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.