(file_path: Path)
| 19397 | return False |
| 19398 | |
| 19399 | def _compute_face_hashes(file_path: Path): |
| 19400 | md5_h = hashlib.md5() |
| 19401 | sha256_h = hashlib.sha256() |
| 19402 | with open(file_path, "rb") as fh: |
| 19403 | while True: |
| 19404 | chunk = fh.read(1024 * 1024) |
| 19405 | if not chunk: |
| 19406 | break |
| 19407 | md5_h.update(chunk) |
| 19408 | sha256_h.update(chunk) |
| 19409 | return {"md5": md5_h.hexdigest(), "sha256": sha256_h.hexdigest()} |
| 19410 | |
| 19411 | def _latin1(v): |
| 19412 | return str(v).encode("latin-1", "ignore").decode("latin-1") |
no outgoing calls
no test coverage detected