Skip to content

Instantly share code, notes, and snippets.

@resba
Created August 23, 2022 14:39
Show Gist options
  • Save resba/30aad10bcbbefaec164c539254a44416 to your computer and use it in GitHub Desktop.
Save resba/30aad10bcbbefaec164c539254a44416 to your computer and use it in GitHub Desktop.
the best function
class StringKeyGenerator(object):
def __init__(self, len=64):
self.lenght = len
def __call__(self):
return ''.join(random.choice(string.ascii_letters + string.digits) for x in range(self.lenght))
def salt(self):
return ''.join(random.choice(string.ascii_uppercase) for x in range(self.lenght))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment