(path)
| 292 | |
| 293 | |
| 294 | def _get_b64_sha256(path): |
| 295 | with open(path, "rb") as f: |
| 296 | file_bytes = f.read() |
| 297 | digest_bytes = hashlib.sha256(file_bytes).digest() |
| 298 | encoded = base64.urlsafe_b64encode(digest_bytes).rstrip(b"=") |
| 299 | return encoded.decode("utf-8") |
| 300 | |
| 301 | |
| 302 | @contextlib.contextmanager |
no test coverage detected