Improvementz
This commit is contained in:
parent
cf9e49235b
commit
be348e5b29
2 changed files with 6 additions and 2 deletions
|
@ -18,7 +18,7 @@
|
|||
<div id="length">Waiting...</div>
|
||||
|
||||
<div id="info">
|
||||
v0.0.1 | © Nicd 2022 | <a href="https://gitlab.com/Nicd/tahnaroskakori" target="_blank">Source</a> | <a
|
||||
v0.0.2 | © Nicd 2022 | <a href="https://gitlab.com/Nicd/tahnaroskakori" target="_blank">Source</a> | <a
|
||||
href="./licenses.txt" target="_blank">Licenses</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -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}`);
|
||||
|
|
Loading…
Reference in a new issue