MCPcopy Index your code
hub / github.com/Breakthrough/PySceneDetect / hash_zip_contents

Function hash_zip_contents

scripts/finalize_windows_dist.py:86–103  ·  view source on GitHub ↗
(zip_path: Path)

Source from the content-addressed store, hash-verified

84
85
86def hash_zip_contents(zip_path: Path) -> list[dict]:
87 entries = []
88 with zipfile.ZipFile(zip_path) as zf:
89 for info in sorted(zf.infolist(), key=lambda i: i.filename):
90 if info.is_dir():
91 continue
92 h = hashlib.sha256()
93 with zf.open(info) as f:
94 for block in iter(lambda: f.read(CHUNK), b""):
95 h.update(block)
96 entries.append(
97 {
98 "path": info.filename,
99 "size": info.file_size,
100 "sha256": h.hexdigest(),
101 }
102 )
103 return entries
104
105
106def verify_authenticode(path: Path) -> None:

Callers 1

write_manifestsFunction · 0.85

Calls 2

updateMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected