herolib_python/lib/tools/md5.py
2025-08-05 15:15:36 +02:00

13 lines
326 B
Python

import hashlib
from typing import List
def file_md5(file_path: str) -> str:
"""
Compute the MD5 hash of the file content.
"""
hash_md5 = hashlib.md5()
with open(file_path, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()