token生成器


方法一:

import string 
count = 8 
str_from = string.ascii_letters + string.digits "".join([random.choice(str_from) for _ in range(count)])
 
方法二:
import string
str_from = string.ascii_letters + string.digits
tokens = [] 
count = 10 
for i in range(count):
    s = random.choice(str_from)
#     print(s)
    tokens.append(s)
    
"".join(tokens)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM