15 lines
284 B
Python
15 lines
284 B
Python
"""Shared utils function."""
|
|
import random
|
|
import string
|
|
|
|
from paste import config
|
|
|
|
|
|
def generate_id() -> str:
|
|
"""
|
|
Generate url id format.
|
|
:return: Url id.
|
|
"""
|
|
return "".join(
|
|
random.choices(string.ascii_letters + string.digits, k=config.URL_LENGTH)
|
|
)
|