From ff768cc9febfd49f0565b8d2f9dccfa1362daa18 Mon Sep 17 00:00:00 2001 From: Max Gautier Date: Sat, 21 Dec 2024 21:42:06 +0100 Subject: [PATCH] download: support multiple hash algorithm --- scripts/download_hash.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/download_hash.py b/scripts/download_hash.py index 7abc1838b..4c7102bcb 100644 --- a/scripts/download_hash.py +++ b/scripts/download_hash.py @@ -272,7 +272,10 @@ def download_hash(only_downloads: [str]) -> None: allow_redirects=True) hash_file.raise_for_status() if downloads[component].get('binary', False): - return hashlib.sha256(hash_file.content).hexdigest() + return hashlib.new( + downloads[component].get('hashtype', 'sha256'), + hash_file.content + ).hexdigest() return (hash_file.content.decode().split()[0])