mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-19 19:46:55 +08:00
feat(mcp): add torrent filter workflow and moviepilot cli skill
This commit is contained in:
@@ -109,6 +109,19 @@ class HashUtils:
|
||||
data = data.encode(encoding)
|
||||
return hashlib.md5(data).hexdigest()
|
||||
|
||||
@staticmethod
|
||||
def sha1(data: Union[str, bytes], encoding: str = "utf-8") -> str:
|
||||
"""
|
||||
生成数据的SHA-1哈希值,并以字符串形式返回
|
||||
|
||||
:param data: 输入的数据,类型为字符串或字节
|
||||
:param encoding: 字符串编码类型,默认使用UTF-8
|
||||
:return: 生成的SHA-1哈希字符串
|
||||
"""
|
||||
if isinstance(data, str):
|
||||
data = data.encode(encoding)
|
||||
return hashlib.sha1(data).hexdigest()
|
||||
|
||||
@staticmethod
|
||||
def md5_bytes(data: Union[str, bytes], encoding: str = "utf-8") -> bytes:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user