play/scripts/pppassword

16 lines
246 B
Plaintext
Raw Normal View History

2018-09-14 19:07:05 +00:00
#!/usr/bin/env python3
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)]))