File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,8 +36,6 @@ class ChecksumCalculator:
3636 """ The ChecksumCalculator encapsulates calling various library functions based on the required checksum to
3737 be calculated on a file."""
3838
39- READ_BLOCKSIZE = 10 * 1024 * 1024 # Do I/O in 10MiB chunks.
40-
4139 def __init__ (self , filename , checksums = CHECKSUM_NAMES ):
4240 self ._filename = filename
4341 self ._checksums = checksums
@@ -49,7 +47,7 @@ def compute(self):
4947 _multipart_chunksize = get_s3_multipart_chunk_size (_file_size )
5048 with ChecksummingSink (_multipart_chunksize , hash_functions = self ._checksums ) as sink :
5149 with open (self ._filename , 'rb' ) as _file_object :
52- sink .write (_file_object .read (self . READ_BLOCKSIZE ))
50+ sink .write (_file_object .read (_multipart_chunksize ))
5351 checksums = sink .get_checksums ()
5452 print ("Checksumming took %.2f milliseconds to compute" % ((time .time () - start_time ) * 1000 ))
5553 return checksums
You can’t perform that action at this time.
0 commit comments