feat: add endpoints to shorten url

This commit is contained in:
2025-07-21 21:49:01 +00:00
parent 7ef8cd9c90
commit 28314e3865
3 changed files with 33 additions and 5 deletions

6
utils.py Normal file
View File

@@ -0,0 +1,6 @@
import string
import random
def generate_shortcode(length=6) -> str:
characters = string.ascii_letters + string.digits
return ''.join(random.choice(characters) for _ in range(length))