perf: 密码首位不包含特殊字符

pull/8935/head
feng626 2022-10-09 20:12:55 +08:00 committed by Jiangjie.Bai
parent fae5d07df6
commit a487d30001
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ def random_string(length, lower=True, upper=True, digit=True, special_char=False
if special_char:
spc = random.choice(string_punctuation)
i = random.choice(range(len(password)))
i = random.choice(range(1, len(password)))
password[i] = spc
password = ''.join(password)