18 lines
326 B
Python
Executable file
18 lines
326 B
Python
Executable file
# ruff: noqa: S311
|
|
"""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)
|
|
)
|