File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed
Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change 1414
1515def generate_active_code ():
1616 active_code = []
17- ascii_ = list (string .ascii_letters )
18- for i in range (200 ):
19- active_code_temp = ""
20- for j in range (19 ):
21- num_or_char = random .randint (0 , 1 )
22- # 用"-"连接
23- if j == 4 or j == 9 or j == 14 :
24- active_code_temp = active_code_temp + "-"
25- # 生成数字
26- elif num_or_char == 0 :
27- active_code_temp = active_code_temp + str (random .randint (0 , 9 ))
28- # 生成字符
29- elif num_or_char == 1 :
30- active_code_temp = active_code_temp + \
31- str (ascii_ [random .randint (0 , len (ascii_ ) - 1 )])
32- active_code .append (active_code_temp )
17+ ascii_ = string .ascii_letters + string .digits
18+ active_code = ["" .join ([random .choice (ascii_ ) for i in range (16 )])
19+ for i in range (200 )]
3320
3421 return active_code
3522
You can’t perform that action at this time.
0 commit comments