Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env python3
import secrets
s = secrets.token_urlsafe(15)
n1 = secrets.randbelow(len(s))
n2 = secrets.randbelow(len(s))
a = '~!@#$%^&*()-_+=:;'
a1 = secrets.choice(a)
a2 = secrets.choice(a)
t = s[:n1] + a1 + s[n1:]
t = t[:n2] + a2 + t[n2:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment