mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-01 09:39:59 +08:00
update v0.1
This commit is contained in:
@@ -3,6 +3,7 @@ import json
|
||||
import time
|
||||
import random
|
||||
import hashlib
|
||||
import string
|
||||
|
||||
|
||||
def _md5(text):
|
||||
@@ -11,7 +12,15 @@ def _md5(text):
|
||||
return md5.hexdigest()
|
||||
|
||||
|
||||
def get_ds(q: str = "", b: dict = None):
|
||||
def get_old_ds() -> str:
|
||||
n = Config.get_config("genshin", "n")
|
||||
i = str(int(time.time()))
|
||||
r = ''.join(random.sample(string.ascii_lowercase + string.digits, 6))
|
||||
c = _md5("salt=" + n + "&t=" + i + "&r=" + r)
|
||||
return i + "," + r + "," + c
|
||||
|
||||
|
||||
def get_ds(q: str = "", b: dict = None) -> str:
|
||||
if b:
|
||||
br = json.dumps(b)
|
||||
else:
|
||||
@@ -23,6 +32,13 @@ def get_ds(q: str = "", b: dict = None):
|
||||
return t + "," + r + "," + c
|
||||
|
||||
|
||||
def random_hex(length: int) -> str:
|
||||
result = hex(random.randint(0, 16 ** length)).replace("0x", "").upper()
|
||||
if len(result) < length:
|
||||
result = "0" * (length - len(result)) + result
|
||||
return result
|
||||
|
||||
|
||||
element_mastery = {
|
||||
"anemo": "风",
|
||||
"pyro": "火",
|
||||
|
||||
Reference in New Issue
Block a user