Efficient checksum calculating on lagre files

Nick Craig-Wood nick at craig-wood.com
Wed Feb 9 05:31:22 EST 2005


Thomas Heller <theller at python.net> wrote:
>  Nick Craig-Wood <nick at craig-wood.com> writes:
> > Here is an implementation of md5sum in python.  Its the same speed
> > give or take as md5sum itself.  This isn't suprising since md5sum is
> > dominated by CPU usage of the MD5 routine (in C in both cases) and/or
> > io (also in C).
> 
>  Your code won't work correctly on Windows, since you have to open files
>  with mode 'rb'.

Yes you are correct (good old Windows ;-)

>  But there's a perfect working version in the Python distribution already:
>  tools/Scripts/md5sum.py

The above is easier to understand though.

-- 
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick



More information about the Python-list mailing list