This repository has been archived on 2023-10-10. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
paste/paste/utils.py

17 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)
)