'commit'
This commit is contained in:
@@ -51,6 +51,13 @@ def get_file_md5(file_path):
|
||||
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):
|
||||
"""
|
||||
计算图片核心内容的 MD5 值(排除状态栏和导航栏)
|
||||
|
||||
Reference in New Issue
Block a user