Bug 1455143 - Use a reasonable buffer size for reading files; r?Build
Reading in 1kb chunks in 2018 is insane.
MozReview-Commit-ID: 7wJv6fTAOh7
--- a/build/checksums.py
+++ b/build/checksums.py
@@ -7,17 +7,17 @@ from __future__ import with_statement
from optparse import OptionParser
import hashlib
import logging
import os
logger = logging.getLogger('checksums.py')
-def digest_file(filename, digest, chunk_size=1024):
+def digest_file(filename, digest, chunk_size=131072):
'''Produce a checksum for the file specified by 'filename'. 'filename'
is a string path to a file that is opened and read in this function. The
checksum algorithm is specified by 'digest' and is a valid OpenSSL
algorithm. If the digest used is not valid or Python's hashlib doesn't
work, the None object will be returned instead. The size of blocks
that this function will read from the file object it opens based on
'filename' can be specified by 'chunk_size', which defaults to 1K'''
assert not os.path.isdir(filename), 'this function only works with files'