Explorar el Código

Fix utils init

StrayWarrior hace 2 días
padre
commit
56a1cc44e7
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      pqai_agent/utils/__init__.py

+ 8 - 0
pqai_agent/utils/__init__.py

@@ -0,0 +1,8 @@
+import hashlib
+import random
+import time
+
+def random_str() -> str:
+    """生成一个随机的MD5字符串"""
+    random_string = str(random.randint(0, 1000000)) + str(time.time())
+    return hashlib.md5(random_string.encode('utf-8')).hexdigest()