From 06cb1ecbb00ea787e964fbd5fc2d321140a0b5a1 Mon Sep 17 00:00:00 2001 From: Drobysh Date: Mon, 2 Nov 2026 09:41:14 +0000 Subject: [PATCH 1/2] =?UTF-8?q?[Eva]=20=D0=A3=D0=B1=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BD=D0=B5=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D1=83=D0=B5=D0=BC=D1=8B=D0=B9=20=D0=B8=D0=BC=D0=BF=D0=BE=D1=80?= =?UTF-8?q?=D1=82=20hashlib?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/bubblewords.py | 1 - 1 file changed, 1 deletion(-) diff --git a/routers/bubblewords.py b/routers/bubblewords.py index 6994424..f4ba05c 100644 --- a/routers/bubblewords.py +++ b/routers/bubblewords.py @@ -1,5 +1,4 @@ import random -import hashlib # 🔧 НОВОЕ: импорт hashlib для стабильного хэширования import json from fastapi import APIRouter, Request, HTTPException from auth import require_auth From 4e444499d4ecb53e6c780e1f4b2b8fe7ff9d9582 Mon Sep 17 00:00:00 2001 From: Drobysh Date: Mon, 2 Nov 2026 09:41:25 +0000 Subject: [PATCH 2/2] =?UTF-8?q?[Eva]=20=D0=A3=D0=B1=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BC=D1=83=D1=81=D0=BE=D1=80=D0=BD=D1=8B=D0=B9=20?= =?UTF-8?q?=D1=81=D1=83=D1=84=D1=84=D0=B8=D0=BA=D1=81=20=D0=B8=D0=B7=20?= =?UTF-8?q?=D1=87=D0=B0=D1=81=D1=82=D0=B5=D0=B9=20=D1=81=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/bubblewords.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/routers/bubblewords.py b/routers/bubblewords.py index f4ba05c..53efb20 100644 --- a/routers/bubblewords.py +++ b/routers/bubblewords.py @@ -81,15 +81,9 @@ def split_word_into_parts(word: str, forbidden_parts: set = None) -> list: attempts += 1 # Если за 50 попыток не нашли уникальное разбиение — - # разбиваем слово ПО БУКВАМ и добавляем суффикс с хешем слова - # Такой суффикс гарантированно уникален для каждого слова - # 🔧 ИСПРАВЛЕНО: заменён hash() на hashlib.md5 для стабильности между запусками - word_hash = hashlib.md5(word.encode('utf-8')).hexdigest()[:4] # Берём первые 4 символа MD5 - unique_parts = [] - for idx, letter in enumerate(word): - unique_parts.append(f"{letter}.{word_hash}.{idx}") - - return unique_parts + # разбиваем слово ПО БУКВАМ (каждая буква — отдельный пузырь). + # Без суффиксов: части остаются чистыми, игрок видит обычные буквы. + return [letter for letter in word] @router.get("/next")