mirror of
https://github.com/freedoom/freedoom.git
synced 2025-09-01 04:25:45 -04:00
makejson: Add SHA3, BLAKE2b, deprecate MD5
The MD5 hash algorithm has been deprecated industry-wide for many years now and we should stop using it. As a replacement, add SHA3 and BLAKE2b. We keep the MD5 hash for now but with a TODO to remove entirely it in a future release.
This commit is contained in:
parent
8d62f506ee
commit
f6b286f195
1 changed files with 8 additions and 7 deletions
|
@ -42,14 +42,15 @@ if json_file is None:
|
||||||
sys.stderr.write("JSON file not specified!\n")
|
sys.stderr.write("JSON file not specified!\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
with open("wads/freedoom1.wad", "rb") as f:
|
for filename in iwads:
|
||||||
iwads["freedoom1.wad"]["md5"] = hashlib.md5(f.read()).hexdigest()
|
with open(os.path.join("wads", filename), "rb") as f:
|
||||||
|
data = f.read()
|
||||||
|
# TODO: MD5 is long-deprecated throughout the industry; this hash
|
||||||
|
# will be removed in a future version.
|
||||||
|
iwads[filename]["md5"] = hashlib.md5(data).hexdigest()
|
||||||
|
iwads[filename]["sha3"] = hashlib.sha3_512(data).hexdigest()
|
||||||
|
iwads[filename]["blake2b"] = hashlib.blake2b(data).hexdigest()
|
||||||
|
|
||||||
with open("wads/freedoom2.wad", "rb") as f:
|
|
||||||
iwads["freedoom2.wad"]["md5"] = hashlib.md5(f.read()).hexdigest()
|
|
||||||
|
|
||||||
with open("wads/freedm.wad", "rb") as f:
|
|
||||||
iwads["freedm.wad"]["md5"] = hashlib.md5(f.read()).hexdigest()
|
|
||||||
|
|
||||||
iwads["freedoom1.wad"]["url"] = (
|
iwads["freedoom1.wad"]["url"] = (
|
||||||
"https://github.com/freedoom/freedoom/releases/download/v"
|
"https://github.com/freedoom/freedoom/releases/download/v"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue