mirror of
https://github.com/djimboy/djimbo_template_aio3.git
synced 2026-07-25 01:34:30 +00:00
Update
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user