Re: checksum problem

2018-01-30 Thread Chris Angelico
On Wed, Jan 31, 2018 at 6:21 AM, Peter Pearson wrote: > On Tue, 30 Jan 2018 11:24:07 +0100, jak wrote: >> with open(fname, "rb") as fh: >> for data in fh.read(m.block_size * blocks): >> m.update(data) >> return m.hexdigest() >> > > I believe your "for data in fh.re

Re: checksum problem

2018-01-30 Thread Peter Pearson
On Tue, 30 Jan 2018 11:24:07 +0100, jak wrote: > Hello everybody, > I'm using python 2.7.14 and calculating the checksum with the sha1 > algorithm and this happens: the checksum is wrong until I read the whole > file in one shot. Here is a test program: > > import hashlib > > def Checksum(fname,