diff --git a/tgbot/utils/const_functions.py b/tgbot/utils/const_functions.py index b39697d..d660c22 100644 --- a/tgbot/utils/const_functions.py +++ b/tgbot/utils/const_functions.py @@ -1,6 +1,7 @@ # - *- coding: utf- 8 - *- import random import time +import uuid from datetime import datetime from typing import Union @@ -132,6 +133,14 @@ def convert_date(from_time, full: bool = True, second: bool = True) -> Union[str return to_time +# Генерация уникального айди +def gen_id() -> int: + mac_address = uuid.getnode() + time_unix = int(str(time.time_ns())[:16]) + + return mac_address + time_unix + + # Генерация пароля | default, number, letter, onechar def gen_password(len_password: int = 16, type_password: str = "default") -> str: if type_password == "default":