mirror of
https://github.com/iio612/DEFENDER.git
synced 2026-02-13 11:14:23 +00:00
V5.1.8
This commit is contained in:
13
core/base.py
13
core/base.py
@@ -1,7 +1,7 @@
|
||||
import time, threading, os, random, socket, hashlib, ipaddress, logging, requests, json, re, ast
|
||||
from dataclasses import fields
|
||||
from typing import Union, Literal
|
||||
from base64 import b64decode
|
||||
from base64 import b64decode, b64encode
|
||||
from datetime import datetime
|
||||
from sqlalchemy import create_engine, Engine, Connection, CursorResult
|
||||
from sqlalchemy.sql import text
|
||||
@@ -678,6 +678,17 @@ class Base:
|
||||
self.logs.critical(f'This remote ip is not valid : {ve}')
|
||||
return None
|
||||
|
||||
# def encode_ip(self, remote_ip_address: str) -> Union[str, None]:
|
||||
|
||||
# binary_ip = b64encode()
|
||||
# try:
|
||||
# decoded_ip = ipaddress.ip_address(binary_ip)
|
||||
|
||||
# return decoded_ip.exploded
|
||||
# except ValueError as ve:
|
||||
# self.logs.critical(f'This remote ip is not valid : {ve}')
|
||||
# return None
|
||||
|
||||
def get_random(self, lenght:int) -> str:
|
||||
"""
|
||||
Retourn une chaîne aléatoire en fonction de la longueur spécifiée.
|
||||
|
||||
Reference in New Issue
Block a user