diff --git a/index.html b/index.html index e97c17d..b5f9014 100644 --- a/index.html +++ b/index.html @@ -18,7 +18,7 @@
Waiting...
- v0.0.1 | © Nicd 2022 | Source | Source | Licenses
diff --git a/tahnaroskakori.js b/tahnaroskakori.js index d395096..94cc02c 100644 --- a/tahnaroskakori.js +++ b/tahnaroskakori.js @@ -49,12 +49,16 @@ async function init() { clearTimeout(compressTimeout); } + if (codeEl.value === "") { + return; + } + compressTimeout = setTimeout(async () => { const content = codeEl.value; const compressed = compress(ENCODER.encode(content), { quality: QUALITY }); const encoded = BASE66CODEC.encode(compressed); - lengthEl.textContent = `Length: ${content.length} chars -> ${compressed.length} bytes -> ${encoded.length} chars`; + lengthEl.textContent = `Length: ${content.length} chars -> ${compressed.length} bytes -> ${encoded.length}/${maxHashLength()} chars`; if (encoded.length <= maxHashLength()) { history.replaceState(null, "", `#${encoded}`);