Address Q000 @ `print-hash.py`
This commit is contained in:
parent
b02d39bbf5
commit
5569480d08
|
@ -4,7 +4,7 @@ import sys
|
||||||
|
|
||||||
packages_dir = pathlib.Path(sys.argv[1]).resolve().absolute()
|
packages_dir = pathlib.Path(sys.argv[1]).resolve().absolute()
|
||||||
|
|
||||||
print("Showing hash values of files to be uploaded:")
|
print('Showing hash values of files to be uploaded:')
|
||||||
|
|
||||||
for file_object in packages_dir.iterdir():
|
for file_object in packages_dir.iterdir():
|
||||||
sha256 = hashlib.sha256()
|
sha256 = hashlib.sha256()
|
||||||
|
@ -12,7 +12,7 @@ for file_object in packages_dir.iterdir():
|
||||||
blake2_256 = hashlib.blake2b(digest_size=256 // 8)
|
blake2_256 = hashlib.blake2b(digest_size=256 // 8)
|
||||||
|
|
||||||
print(file_object)
|
print(file_object)
|
||||||
print("")
|
print('')
|
||||||
|
|
||||||
content = file_object.read_bytes()
|
content = file_object.read_bytes()
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ for file_object in packages_dir.iterdir():
|
||||||
md5.update(content)
|
md5.update(content)
|
||||||
blake2_256.update(content)
|
blake2_256.update(content)
|
||||||
|
|
||||||
print(f"SHA256: {sha256.hexdigest()}")
|
print(f'SHA256: {sha256.hexdigest()}')
|
||||||
print(f"MD5: {md5.hexdigest()}")
|
print(f'MD5: {md5.hexdigest()}')
|
||||||
print(f"BLAKE2-256: {blake2_256.hexdigest()}")
|
print(f'BLAKE2-256: {blake2_256.hexdigest()}')
|
||||||
print("")
|
print('')
|
||||||
|
|
Loading…
Reference in New Issue