Browse Source

download: support multiple hash algorithm

pull/11891/head
Max Gautier 2 months ago
parent
commit
ff768cc9fe
Failed to extract signature
1 changed files with 4 additions and 1 deletions
  1. 5
      scripts/download_hash.py

5
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])

Loading…
Cancel
Save