This commit is contained in:
dj
2023-10-03 02:00:14 +03:00
parent fc8d01d82b
commit 72dc50b9cb
+9
View File
@@ -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":