High quality, simple random password generator

前端 未结 27 2489
渐次进展
渐次进展 2020-12-22 17:06

I\'m interested in creating a very simple, high (cryptographic) quality random password generator. Is there a better way to do this?

import os, random, strin         


        
27条回答
  •  情歌与酒
    2020-12-22 17:22

    FYI for anyone running across this question in the year 2020+. Python 3.6+ has a secrets module specifically for this purpose:

    import secrets
    
    password_length = 13
    print(secrets.token_urlsafe(password_length))
    

提交回复
热议问题