From c55faa80f203d74bd491fde5688af7c2dc798423 Mon Sep 17 00:00:00 2001 From: Blake Ridgway Date: Wed, 12 Feb 2025 20:58:25 -0600 Subject: [PATCH] first commit --- string_generator.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 string_generator.py diff --git a/string_generator.py b/string_generator.py new file mode 100644 index 0000000..bfc42f6 --- /dev/null +++ b/string_generator.py @@ -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" +