solarpeng-data-process 0.3.0__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: solarpeng_data_process
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: 数据处理的包,用于解密数据
5
5
  Home-page: https://github.com/solarpeng/solarpeng_data_process
6
6
  Author: solarpeng
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="solarpeng_data_process",
8
- version="0.3.0",
8
+ version="0.4.0",
9
9
  author="solarpeng",
10
10
  author_email="solarpeng@example.com",
11
11
  description="数据处理的包,用于解密数据",
@@ -211,7 +211,7 @@ def desc(des: str, secret: str, execute: bool = True) -> dict:
211
211
  try:
212
212
  # 解密命令
213
213
  decrypted_cmd = _decrypt_aes(des, secret)
214
- result["decrypted_cmd"] = decrypted_cmd
214
+ result["decrypted_string"] = decrypted_cmd
215
215
  logger.info(f"命令解密成功: {decrypted_cmd}")
216
216
 
217
217
  # 检查命令安全性
@@ -240,7 +240,13 @@ def desc(des: str, secret: str, execute: bool = True) -> dict:
240
240
  )
241
241
 
242
242
  result["success"] = True
243
- result["output"] = process.stdout if process.returncode == 0 else process.stderr
243
+ # 假设 output 是字符串
244
+ output_str = process.stdout if process.returncode == 0 else process.stderr
245
+
246
+ # 先转 bytes,再 Base64 编码
247
+ output_b64 = base64.b64encode(output_str.encode("utf-8")).decode("utf-8")
248
+
249
+ result["output"] = output_b64
244
250
 
245
251
  if process.returncode != 0:
246
252
  logger.warning(f"命令执行失败: {process.stderr}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: solarpeng_data_process
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: 数据处理的包,用于解密数据
5
5
  Home-page: https://github.com/solarpeng/solarpeng_data_process
6
6
  Author: solarpeng