in tools/build-release.py [0:0]
def get_checksum(file_path, file_name):
print("generating sha512 checksum for %s" % file_name)
h = hashlib.sha512()
# read the file and generate the sha
with open(file_path, 'rb') as file:
while True:
data = file.read(65536)
if not data:
break
h.update(data)
sha = h.hexdigest()
return "%s %s" % (sha, file_name)