Skip to content

Commit

Permalink
fix #83
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdaYH committed Dec 8, 2024
1 parent 5b23a23 commit 9df5f1a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nonebot_plugin_bottle/webui/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import secrets
import string

def generate_password(length=12):
# 定义密码字符集
characters = string.ascii_letters + string.digits + string.punctuation
# 使用secrets.choice来随机选择字符生成密码
password = ''.join(secrets.choice(characters) for _ in range(length))
return password

0 comments on commit 9df5f1a

Please sign in to comment.