mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
rehash hard-codes sha256, remove algo param (#5485)
This commit is contained in:
parent
8ccab7a475
commit
6533f883f6
1 changed files with 3 additions and 3 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue