0.0.0-alpha.3 • Published 1 year ago

@kpv/encoder v0.0.0-alpha.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@kpv/encoder

🚴 Installation

npm install @kpv/encoder

🚴 Usage

Vite

import url from "@kpv/encoder/web/kpv_encoder_bg.wasm?url";
import init, { encode_v0_0_1, decode_v0_0_1 } from "@kpv/encoder/web";

init(url).then(() => {
  const input = new Uint8Array(Array.from({ length: 9999 }, () =>
    Math.floor(Math.random() * 256)
  ));
  const bits = decode_v0_0_1(input);
  encode_v0_0_1(bits);
});

Node.js

const { encode_v0_0_1, decode_v0_0_1 } = require("@kpv/encoder");

const input = Array.from({ length: 9999 }, () =>
  Math.floor(Math.random() * 256)
);
const bits = decode_v0_0_1(input);
encode_v0_0_1(bits);

License