import * as rt from "@sciter"; import * as sys from "@sys"; function show() { let form = document.$("form"); let arrayBuffer = sys.fs.$readfile(URL.toPath(__DIR__ + "test.txt")); let alg = form.value.alg; let arrayBufferCompressed = rt.compress(arrayBuffer,alg); let arrayBufferDecompressed = rt.decompress(arrayBufferCompressed,alg); if( arrayBuffer.compare(arrayBufferDecompressed) ) throw new Error("WTF?"); form.value = { original: arrayBuffer.byteLength, compressed: arrayBufferCompressed.byteLength, }; } document.on("change","form",show); show();