Add 8 new tools: Hash Verifier, URL Tool, String Utils, Cron Explainer, IP Calc, Lorem Ipsum, CSV Viewer, Notes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Nirodan
2026-05-06 09:10:25 +02:00
parent ef03e76950
commit 75062dbf5e
20 changed files with 1727 additions and 2 deletions
+39
View File
@@ -0,0 +1,39 @@
from flask import Blueprint, request, jsonify
import hashlib
import bcrypt
from util.logger import logger
from auth.token import verify_token
hashverifier_blueprint = Blueprint('hashverifier_tool', __name__)
@hashverifier_blueprint.route('/api/hash/verify', methods=['POST'])
def verify_hash():
user = verify_token()
if not user:
return jsonify({"message": "Nicht autorisiert"}), 401
try:
data = request.get_json() or {}
text = data.get("text", "")
hash_val = data.get("hash", "").strip()
algorithm = data.get("algorithm", "sha256")
if algorithm == "md5":
computed = hashlib.md5(text.encode()).hexdigest()
match = computed.lower() == hash_val.lower()
elif algorithm == "sha256":
computed = hashlib.sha256(text.encode()).hexdigest()
match = computed.lower() == hash_val.lower()
elif algorithm == "bcrypt":
try:
match = bcrypt.checkpw(text.encode(), hash_val.encode())
except Exception:
return jsonify({"message": "Ungültiger bcrypt-Hash"}), 400
else:
return jsonify({"message": "Unbekannter Algorithmus"}), 400
logger.info(f"Hash verify ({algorithm}) von {user['username']}: {match}")
return jsonify({"match": match})
except Exception as e:
logger.error(f"Fehler bei Hash-Verifikation: {e}")
return jsonify({"message": "Fehler bei der Verifikation"}), 500