dotfiles/private/genpass.py
2024-10-20 16:32:01 +04:00

11 lines
200 B
Python

import secrets
with open("words.txt", "rt") as f:
lines = [l.strip() for l in f]
bits = secrets.randbits(300)
mx = len(lines)
while bits > 0:
print(lines[bits % mx], end=' ')
bits //= mx
print()