0.0.5 • Published 12 months ago

crystal-compressor v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

A simple tool to compress and decompress typed arrays in JavaScript.

import { CrystalCompressor } from "../out/index.js";

const testArray = new Uint32Array(67_000);

for (let i = 0; i < testArray.length; i++) {
 let zero = Math.random() > 0.5;
 if (zero) {
  testArray[i] = 0;
 } else {
  testArray[i] = ((Math.random() - 0.5) * 2 * 2 ** 32) >> 0;
 }
}


const compressedArray = await CrystalCompressor.compressArray(testArray);

const decompressedArray = await CrystalCompressor.decompressArray(
 compressedArray.buffer,
 "Uint32"
);
0.0.5

12 months ago

0.0.3

1 year ago

0.0.4

1 year ago

0.0.2

2 years ago

0.0.1

2 years ago