md5 differences

Python python at rgbaz.eu
Wed Sep 10 13:12:28 EDT 2008


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

>
> "Python" <python at rgbaz.eu> wrote in message
> news:mailman.799.1221063937.3487.python-list at python.org...
>
>> here's an example:
>> Arno at Computer:~% 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:

Arno at Computer:~% echo "test" > test.txt

Arno at Computer:~% md5 test.txt
MD5 (test.txt) = d8e8fca2dc0f896fd7cb4cb0031ba249

Arno at Computer:~% 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



More information about the Python-list mailing list