MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / get_select_token

Function get_select_token

core/utils.py:43–54  ·  view source on GitHub ↗

获取下载token :param code: :return:

(code: str)

Source from the content-addressed store, hash-verified

41
42
43async def get_select_token(code: str):
44 """
45 获取下载token
46 :param code:
47 :return:
48 """
49 token = getattr(settings, "jwt_secret", "")
50 if not token:
51 raise RuntimeError("应用签名密钥未初始化")
52 return hashlib.sha256(
53 f"{code}{int(time.time() / 1000)}000{token}".encode()
54 ).hexdigest()
55
56
57async def get_file_url(code: str):

Callers 2

download_fileFunction · 0.90
get_file_urlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected