md5 wrongness?

Ron Johnson ron.l.johnson at cox.net
Sat Nov 24 14:30:43 CET 2007


On 11/24/07 02:27, Ayaz Ahmed Khan wrote:
> 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  -

Thanks to all.  I knew there had to be operator error, but I
couldn't figure out where...

-- 
Ron Johnson, Jr.
Jefferson LA  USA

%SYSTEM-F-FISH, my hovercraft is full of eels



More information about the Python-list mailing list