MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / generate_random_string

Function generate_random_string

src/core/utils.py:120–131  ·  view source on GitHub ↗

生成随机字符串(仅字母) Args: length: 字符串长度 Returns: 随机字符串

(length: int = 8)

Source from the content-addressed store, hash-verified

118
119
120def generate_random_string(length: int = 8) -> str:
121 """
122 生成随机字符串(仅字母)
123
124 Args:
125 length: 字符串长度
126
127 Returns:
128 随机字符串
129 """
130 chars = string.ascii_letters
131 return ''.join(secrets.choice(chars) for _ in range(length))
132
133
134def generate_uuid() -> str:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected