From 77f334e96b9388a728c266f375c67cb8c3c0333c Mon Sep 17 00:00:00 2001 From: Austin Bozowski Date: Tue, 31 May 2022 07:16:09 +0000 Subject: [PATCH] MD5 memory --- examples/chef/chef.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/chef/chef.py b/examples/chef/chef.py index e030cdd0c95abd..79559f27a2eb8b 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -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: