On 10 sep 2008, at 18:30, Richard Brodie wrote:


"Python" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

here's an example:
[EMAIL PROTECTED]:~% echo "hello" | md5
b1946ac92492d2347c6235b4d2611184
How do I get the same results?

Checksum the same string.

md5.new("hello\n").hexdigest()
'b1946ac92492d2347c6235b4d2611184'



hmm and this then:

[EMAIL PROTECTED]:~% echo "test" > test.txt

[EMAIL PROTECTED]:~% md5 test.txt
MD5 (test.txt) = d8e8fca2dc0f896fd7cb4cb0031ba249

[EMAIL PROTECTED]:~% python
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import md5
>>> md5.new("/Volumes/data/Arno/test.txt").hexdigest()
'90364ed45b452d43378629c20543a81d'


even
echo -n "hello" | md5
doesn't return the same number


gr
Arno
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to