...
This commit is contained in:
13
herolib/tools/md5.py
Normal file
13
herolib/tools/md5.py
Normal file
@@ -0,0 +1,13 @@
|
||||
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()
|
Reference in New Issue
Block a user