On Nov 24, 1:34 pm, Ron Johnson <[EMAIL PROTECTED]> 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' >>> > > $ md5sum --version > md5sum (GNU coreutils) 5.97 > > $ echo snagglefrob | md5sum > f842244d79af85b457811091319d85ff - > $ echo 'snagglefrob' | md5sum > f842244d79af85b457811091319d85ff - > $ echo "snagglefrob" | md5sum > f842244d79af85b457811091319d85ff - > > $ python > Python 2.4.4 (#2, Aug 16 2007, 02:03:40) > [GCC 4.1.3 20070812 (prerelease) (Debian 4.1.2-15)] on linux2 > Type "help", "copyright", "credits" or "license" for more information.>>> > import md5 > >>> s = md5.new() > >>> s.update('snagglefrob') > >>> s.hexdigest() > > '9eb2459fcdd9f9b8a9fef7348bcac933' > > -- > Ron Johnson, Jr. > Jefferson LA USA > > %SYSTEM-F-FISH, my hovercraft is full of eels -- http://mail.python.org/mailman/listinfo/python-list