md5 wrongness?

Ayaz Ahmed Khan ayaz at dev.null
Sat Nov 24 03:27:11 EST 2007


John Machin wrote:
> On Nov 24, 1:34 pm, Ron Johnson <ron.l.john... at cox.net> wrote:
>> Why do Python's md5 and GNU md5sum produce differing results?
> 
> They don't differ. Try feeding them the same input:
> 
>>>> import md5
>>>> md5.new('snagglefrob').hexdigest()
> '9eb2459fcdd9f9b8a9fef7348bcac933'
>>>> md5.new('snagglefrob\n').hexdigest()
> 'f842244d79af85b457811091319d85ff'
>>>>

Or, alternatively:

$ echo -n snagglefrob | md5sum
9eb2459fcdd9f9b8a9fef7348bcac933  -

-- 
Ayaz Ahmed Khan



More information about the Python-list mailing list