'commit'
This commit is contained in:
@@ -48,6 +48,13 @@ def get_file_md5(file_path):
|
||||
for chunk in iter(lambda: f.read(4096), b""):
|
||||
hash_md5.update(chunk)
|
||||
return hash_md5.hexdigest()
|
||||
|
||||
def get_name_md5(name):
|
||||
if not name:
|
||||
return "unknown"
|
||||
if not isinstance(name, str):
|
||||
name = str(name)
|
||||
return hashlib.md5(name.encode("utf-8")).hexdigest()
|
||||
|
||||
def get_image_content_md5(file_path, top_ratio=0.1, bottom_ratio=0.1):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user