I *think* hash calculation and verifier have to be outside of the loop to avoid the overhead. I will confirm it with a manual testing.
for chunk in utils.chunkreadable(image_file, self.WRITE_CHUNKSIZE): image_data += chunk image_size += len(chunk) os_hash_value.update(chunk) checksum.update(chunk) if verifier: verifier.update(chunk)
I *think* hash calculation and verifier have to be outside of the loop to avoid the overhead. I will confirm it with a manual testing.
for chunk in utils.chunkread able(image_ file, self.WRITE_ CHUNKSIZE) :
image_ data += chunk
image_ size += len(chunk)
os_ hash_value. update( chunk)
checksum. update( chunk)
verifier. update( chunk)
if verifier: