import os
import random
import string
import uuid


def random_str(len : int):
    return ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(len))


def random_int(len : int):
    return ''.join(random.SystemRandom().choice(string.digits) for _ in range(len))


def clear():
    os.system("cls" if os.name == "nt" else "clear")


def chance(probability: float) -> bool:
    if not 0 <= probability <= 1:
        raise ValueError("Шанс должен быть в диапазоне от 0 до 1")
    return random.random() < probability

def generate_uuid() -> str:
    return str(uuid.uuid4())