Compute SHA-256 hash of a file's content. Returns empty string on error.
(path: Path)
| 44 | |
| 45 | |
| 46 | def _hash_file(path: Path) -> str: |
| 47 | """Compute SHA-256 hash of a file's content. Returns empty string on error.""" |
| 48 | try: |
| 49 | hasher = hashlib.sha256() |
| 50 | with open(path, "rb") as f: |
| 51 | for chunk in iter(lambda: f.read(65536), b""): |
| 52 | hasher.update(chunk) |
| 53 | return hasher.hexdigest() |
| 54 | except OSError: |
| 55 | return "" |
| 56 | |
| 57 | |
| 58 | def _find_dlls(build_dir: Path) -> list[Path]: |
no test coverage detected