play/scripts/pppassword

17 lines
284 B
Plaintext
Raw Normal View History

#! /usr/bin/env nix-shell
#! nix-shell -i python3 -p python3
2018-09-14 19:07:05 +00:00
import sys
import os
import secrets
a = "".join(sys.argv[1:])
d = "pq"
if "b" in a:
d = d + "b"
2018-09-14 19:07:05 +00:00
if "u" in a:
d = d + d.upper()
2018-09-14 19:07:05 +00:00
l = 16 + secrets.randbelow(16)
print(''.join([secrets.choice(d) for _ in range(l)]))