Skip to content

Commit 8f05ea5

Browse files
committed
v2.1.5
1 parent 03a0bc9 commit 8f05ea5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app/core/security.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def decrypt(data: bytes, key: bytes) -> Optional[bytes]:
286286
return None
287287

288288

289-
def encrypt_message(message: str, key: bytes):
289+
def encrypt_message(message: str, key: bytes) -> str:
290290
"""
291291
使用给定的key对消息进行加密,并返回加密后的字符串
292292
"""
@@ -295,14 +295,14 @@ def encrypt_message(message: str, key: bytes):
295295
return encrypted_message.decode()
296296

297297

298-
def hash_sha256(message):
298+
def hash_sha256(message: str) -> str:
299299
"""
300300
对字符串做hash运算
301301
"""
302302
return hashlib.sha256(message.encode()).hexdigest()
303303

304304

305-
def aes_decrypt(data, key):
305+
def aes_decrypt(data: str, key: str) -> str:
306306
"""
307307
AES解密
308308
"""
@@ -322,7 +322,7 @@ def aes_decrypt(data, key):
322322
return result.decode('utf-8')
323323

324324

325-
def aes_encrypt(data, key):
325+
def aes_encrypt(data: str, key: str) -> str:
326326
"""
327327
AES加密
328328
"""
@@ -338,7 +338,7 @@ def aes_encrypt(data, key):
338338
return base64.b64encode(cipher.iv + result).decode('utf-8')
339339

340340

341-
def nexusphp_encrypt(data_str: str, key):
341+
def nexusphp_encrypt(data_str: str, key: bytes) -> str:
342342
"""
343343
NexusPHP加密
344344
"""

version.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
APP_VERSION = 'v2.1.4'
2-
FRONTEND_VERSION = 'v2.1.4'
1+
APP_VERSION = 'v2.1.5'
2+
FRONTEND_VERSION = 'v2.1.5'

0 commit comments

Comments
 (0)