Skip to content

Instantly share code, notes, and snippets.

@flionic
Last active June 17, 2019 13:54
Show Gist options
  • Save flionic/cc86595eecb9a2552d5411d8cfa84ec3 to your computer and use it in GitHub Desktop.
Save flionic/cc86595eecb9a2552d5411d8cfa84ec3 to your computer and use it in GitHub Desktop.
import string
import random
def id_generator(size=6, chars=string.ascii_letters + string.digits + '-_'):
# return ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits + '-_') for _ in range(7))
return ''.join(random.choice(chars) for _ in range(size))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment