Skip to content

Commit

Permalink
MD5 memory
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed May 31, 2022
1 parent dd59f1e commit 77f334e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ def generate_device_manifest(
for device_name in _DEVICE_LIST:
device_file_path = os.path.join(_DEVICE_FOLDER, device_name + ".zap")
with open(device_file_path, "rb") as device_file:
device_file_data = device_file.read()
device_file_md5 = hashlib.md5(device_file_data).hexdigest()
file_md5 = hashlib.md5()
while data := device_file.read(128 * 32):
file_md5.update(data)
device_file_md5 = file_md5.hexdigest()
devices_manifest[device_name] = device_file_md5
flush_print(f"Current digest for {device_name} : {device_file_md5}")
if write_manifest_file:
Expand Down

0 comments on commit 77f334e

Please sign in to comment.