Skip to content

Commit

Permalink
v2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Dec 20, 2024
1 parent 03a0bc9 commit 8f05ea5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions app/core/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def decrypt(data: bytes, key: bytes) -> Optional[bytes]:
return None


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


def hash_sha256(message):
def hash_sha256(message: str) -> str:
"""
对字符串做hash运算
"""
return hashlib.sha256(message.encode()).hexdigest()


def aes_decrypt(data, key):
def aes_decrypt(data: str, key: str) -> str:
"""
AES解密
"""
Expand All @@ -322,7 +322,7 @@ def aes_decrypt(data, key):
return result.decode('utf-8')


def aes_encrypt(data, key):
def aes_encrypt(data: str, key: str) -> str:
"""
AES加密
"""
Expand All @@ -338,7 +338,7 @@ def aes_encrypt(data, key):
return base64.b64encode(cipher.iv + result).decode('utf-8')


def nexusphp_encrypt(data_str: str, key):
def nexusphp_encrypt(data_str: str, key: bytes) -> str:
"""
NexusPHP加密
"""
Expand Down
4 changes: 2 additions & 2 deletions version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
APP_VERSION = 'v2.1.4'
FRONTEND_VERSION = 'v2.1.4'
APP_VERSION = 'v2.1.5'
FRONTEND_VERSION = 'v2.1.5'

0 comments on commit 8f05ea5

Please sign in to comment.