import { useState } from 'react'; import axios from '../services/api'; const resultBox = { marginTop: '12px', padding: '12px 14px', background: 'var(--surface-2)', border: '1px solid var(--border)', borderRadius: '12px', display: 'flex', alignItems: 'center', gap: '10px', justifyContent: 'space-between', }; function HasherTool() { const [input, setInput] = useState(''); const [algo, setAlgo] = useState('sha256'); const [result, setResult] = useState(''); const [copied, setCopied] = useState(false); const handleHash = async () => { try { const res = await axios.post(`/api/hash/${algo}`, { text: input }); setResult(res.data[algo]); } catch { alert('Fehler beim Hashen'); } }; const copy = () => { navigator.clipboard.writeText(result); setCopied(true); setTimeout(() => setCopied(false), 1500); }; return (

SHA256 / bcrypt Hasher

Hinweis: bcrypt ist sicher für Passwörter – SHA256 für Datenintegrität.

{ setInput(e.target.value); setResult(''); }} placeholder="Text eingeben" /> {result && (
{result}
)}
); } export default HasherTool;