生成随机字符串(仅字母) Args: length: 字符串长度 Returns: 随机字符串
(length: int = 8)
| 118 | |
| 119 | |
| 120 | def 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 | |
| 134 | def generate_uuid() -> str: |
nothing calls this directly
no outgoing calls
no test coverage detected