Skip to content

Commit

Permalink
Merge pull request #2312 from rawkode/feat/adopt-sha256
Browse files Browse the repository at this point in the history
feat(build): switch from md5 to sha256
  • Loading branch information
rawkode authored Mar 30, 2020
2 parents 698a6be + ec7d681 commit 94092cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,10 +586,10 @@ def build(version=None,
logging.info("Time taken: {}s".format((end_time - start_time).total_seconds()))
return True

def generate_md5_from_file(path):
"""Generate MD5 signature based on the contents of the file at path.
def generate_sha256_from_file(path):
"""Generate SHA256 signature based on the contents of the file at path.
"""
m = hashlib.md5()
m = hashlib.sha256()
with open(path, 'rb') as f:
for chunk in iter(lambda: f.read(4096), b""):
m.update(chunk)
Expand Down Expand Up @@ -879,8 +879,8 @@ def main(args):
return 1
logging.info("Packages created:")
for p in packages:
logging.info("{} (MD5={})".format(p.split('/')[-1:][0],
generate_md5_from_file(p)))
logging.info("{} (sha256={})".format(p.split('/')[-1:][0],
generate_sha256_from_file(p)))


if orig_branch != get_current_branch():
Expand Down

0 comments on commit 94092cb

Please sign in to comment.