(path: Path)
| 93 | |
| 94 | |
| 95 | def sha256_file(path: Path) -> str: |
| 96 | digest = hashlib.sha256() |
| 97 | with path.open("rb") as handle: |
| 98 | while True: |
| 99 | chunk = handle.read(1024 * 1024) |
| 100 | if not chunk: |
| 101 | break |
| 102 | digest.update(chunk) |
| 103 | return digest.hexdigest() |
| 104 | |
| 105 | |
| 106 | def sha256_json(value: Any) -> str: |
no outgoing calls
no test coverage detected