remove english words and use numbers instead, fix XSS

This commit is contained in:
csd4ni3l
2025-10-24 18:08:15 +02:00
parent f48980a3c8
commit 91a916f682
7 changed files with 16 additions and 20 deletions
+1 -3
View File
@@ -1,8 +1,6 @@
import easyocr, difflib, random, string
from constants import OCR_CHALLENGE_LENGTH
from english_words import get_english_words_set
words = list(get_english_words_set(['gcide'], lower=True, alpha=True))
reader = easyocr.Reader(['en'])
def check_text_similarity(image_path, text):
@@ -12,4 +10,4 @@ def check_text_similarity(image_path, text):
return image_text, similarity
def generate_challenge(username):
return f"{username} {' '.join([random.choice(words) for _ in range(OCR_CHALLENGE_LENGTH)])}"
return f"{username} {''.join([str(random.randint(0, 10)) for _ in range(OCR_CHALLENGE_LENGTH)])}"