MCPcopy Create free account
hub / github.com/BruceDevices/firmware / hash_files

Function hash_files

patch.py:72–80  ·  view source on GitHub ↗

Generate a combined hash for multiple files.

(file_paths)

Source from the content-addressed store, hash-verified

70
71
72def hash_files(file_paths):
73 """Generate a combined hash for multiple files."""
74 combined_hash = hashlib.sha256()
75
76 for file_path in file_paths:
77 file_hash = hash_file(file_path)
78 combined_hash.update(file_hash.encode("utf-8")) # Update with the file's hash
79
80 return combined_hash.hexdigest()
81
82
83def save_checksum_file(hash_value, output_file):

Callers 1

prepare_www_filesFunction · 0.85

Calls 3

hash_fileFunction · 0.85
sha256Method · 0.80
updateMethod · 0.45

Tested by

no test coverage detected