first commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// ═══════════════════════════════════════════════════════
|
||||
// Hash
|
||||
// ═══════════════════════════════════════════════════════
|
||||
async function generateHash() {
|
||||
const text = document.getElementById('hashInput').value;
|
||||
if (!text) return setStatus('hashStatus','error','Enter text to hash.');
|
||||
const d = await apiPost('/api/hash', { text });
|
||||
if (d.success) {
|
||||
const c = document.getElementById('hashResults');
|
||||
c.innerHTML = Object.entries(d.hashes).map(([algo, hash]) => `
|
||||
<div class="result-row">
|
||||
<div class="label">${algo.toUpperCase()}</div>
|
||||
<div class="value" onclick="copyText(this.textContent)" title="Click to copy">${hash}</div>
|
||||
</div>`).join('');
|
||||
setStatus('hashStatus','success','Generated ✓');
|
||||
} else setStatus('hashStatus','error', d.error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user