[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Poor md5 module performance
- From: Rob Kendrick <rjek@...>
- Date: Mon, 8 Nov 2010 00:33:44 +0000
On Sun, Nov 07, 2010 at 10:44:56PM +0100, Marcin Jurczuk wrote:
> > return fh and md5.sumhexa(io.open(fname,"rb"):read(10485760)) or nil
>
> Try using read("*a").
>
> This will read whole file - a those files have > 500MB usually.
> I need only first 10MB to calculate checksum..
Not interested in corruption or attack on the rest of the file?
The solution here, of course, is to hash a chunk of the file, and then
skip some of the file using a decision based on the output of the
previous hash.
B.