Created
August 4, 2023 14:26
-
-
Save ValentaTomas/6a08810a4a653a9661935e3df9fabdcc to your computer and use it in GitHub Desktop.
Random alphanumeric id generator
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
import random | |
import string | |
characters = string.ascii_letters + string.digits | |
def id(length: int): | |
return "".join(random.choices(characters, k=length)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment