mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-19 13:46:05 +10:00
Return checksum in download_file
This commit is contained in:
@@ -212,7 +212,7 @@ def download_file(link, location):
|
|||||||
file.write(chunk)
|
file.write(chunk)
|
||||||
count += len(chunk)
|
count += len(chunk)
|
||||||
cls()
|
cls()
|
||||||
print(f"- Downloading package")
|
print("- Downloading package")
|
||||||
print(f"- {count / 1024 / 1024}MB Downloaded")
|
print(f"- {count / 1024 / 1024}MB Downloaded")
|
||||||
checksum = hashlib.sha256()
|
checksum = hashlib.sha256()
|
||||||
with location.open("rb") as file:
|
with location.open("rb") as file:
|
||||||
@@ -220,7 +220,7 @@ def download_file(link, location):
|
|||||||
while chunk:
|
while chunk:
|
||||||
checksum.update(chunk)
|
checksum.update(chunk)
|
||||||
chunk = file.read(1024 * 1024 * 16)
|
chunk = file.read(1024 * 1024 * 16)
|
||||||
print(f"- Checksum: {checksum.hexdigest()}")
|
return checksum
|
||||||
|
|
||||||
|
|
||||||
# def menu(title, prompt, menu_options, add_quit=True, auto_number=False, in_between=[], top_level=False):
|
# def menu(title, prompt, menu_options, add_quit=True, auto_number=False, in_between=[], top_level=False):
|
||||||
|
|||||||
Reference in New Issue
Block a user