rehash hard-codes sha256, remove algo param (#5485)

This commit is contained in:
Anthony Sottile 2018-06-11 10:13:32 -07:00 committed by Pradyun Gedam
parent 8ccab7a475
commit 6533f883f6
1 changed files with 3 additions and 3 deletions

View File

@ -51,9 +51,9 @@ VERSION_COMPATIBLE = (1, 0)
logger = logging.getLogger(__name__)
def rehash(path, algo='sha256', blocksize=1 << 20):
"""Return (hash, length) for path using hashlib.new(algo)"""
h = hashlib.new(algo)
def rehash(path, blocksize=1 << 20):
"""Return (hash, length) for path using hashlib.sha256()"""
h = hashlib.sha256()
length = 0
with open(path, 'rb') as f:
for block in read_chunks(f, size=blocksize):