Created
August 23, 2022 14:39
-
-
Save resba/30aad10bcbbefaec164c539254a44416 to your computer and use it in GitHub Desktop.
the best function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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