A WASM binding for eciesrs
npm install ecies-wasm


A WASM binding for eciesrs.
``bash`
npm install ecies-wasm
`js
import init, * as ecies from "ecies-wasm";
init(); // if built with vite without plugin
const data = Uint8Array.from([1, 2, 3, 4]);
const [sk, pk] = ecies.generateKeypair();
const encrypted = ecies.encrypt(pk, data);
const decrypted = ecies.decrypt(sk, encrypted);
alert("decrypted: " + decrypted);
`
Check the example for how to use it in browsers.
`ts`
export function generateKeypair(): Array
export function encrypt(pk: Uint8Array, msg: Uint8Array): Uint8Array;
export function decrypt(sk: Uint8Array, msg: Uint8Array): Uint8Array;
`bash``
wasm-pack build
wasm-pack test --node
See CHANGELOG.md.