first commit
This commit is contained in:
commit
c55faa80f2
1 changed files with 14 additions and 0 deletions
14
string_generator.py
Normal file
14
string_generator.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import secrets
|
||||
import string
|
||||
|
||||
def generate_random_subdomain(length=8):
|
||||
# Choose from alphanumeric characters
|
||||
alphabet = string.ascii_lowercase + string.digits
|
||||
# Generate a random subdomain using the chosen alphabet
|
||||
subdomain = ''.join(secrets.choice(alphabet) for _ in range(length))
|
||||
return f"psql-{subdomain}.rideaware.org"
|
||||
|
||||
# Example usage:
|
||||
random_url = generate_random_subdomain()
|
||||
print(random_url) # e.g., "a1b2c3d4.rideaware.org"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue