(video_path: Path, chunk_size: int = 1024 * 1024)
| 19801 | return None |
| 19802 | |
| 19803 | def _compute_hashes(video_path: Path, chunk_size: int = 1024 * 1024): |
| 19804 | md5_h = hashlib.md5() |
| 19805 | sha256_h = hashlib.sha256() |
| 19806 | with open(video_path, "rb") as fh: |
| 19807 | while True: |
| 19808 | chunk = fh.read(chunk_size) |
| 19809 | if not chunk: |
| 19810 | break |
| 19811 | md5_h.update(chunk) |
| 19812 | sha256_h.update(chunk) |
| 19813 | return {"md5": md5_h.hexdigest(), "sha256": sha256_h.hexdigest()} |
| 19814 | |
| 19815 | def _format_report_value(v): |
| 19816 | if v is None: |
no outgoing calls
no test coverage detected