laya-ad / code /laya-server /scripts /hash-password.py
x6nux's picture
laya-ad v2.2: sync laya-server code (default version v2.2, build_push.sh, .env.example)
0cd599e verified
Raw History Blame Contribute Delete
363 Bytes
from getpass import getpass
from argon2 import PasswordHasher
password = getpass("New administrator password: ")
confirmation = getpass("Confirm password: ")
if len(password) < 10:
raise SystemExit("Use at least 10 characters")
if password != confirmation:
raise SystemExit("Passwords did not match")
print(PasswordHasher().hash(password))