electronade-endecoder
v0.1.0
Published
It's a package for electronade that provides some feature about encryption.
Downloads
3
Readme
electronade-endecoder
It's a package for electronade that provides some feature about encryption. See electronade-endecoder.netlify.app for details.
Installation
npm install electronade-endecoder
What Exposed
electronade: {
endecoder: {
encode: (
params: {
plainText: string;
password: string;
salt: string;
}
) => Promise<string>;
decode: (
params: {
encodedText: string;
password: string;
salt: string;
}
) => Promise<string>;
encrypt: (
params: {
plainBuffer: Buffer;
password: string;
salt: string;
}
) => Promise<string>;
decrypt: (
params: {
encodedText: string;
password: string;
salt: string;
}
) => Promise<Buffer>;
}
}
Usage
See electronade usage for details.
const [
plainText,
password,
salt
] = [
"this is a test",
"password",
"salt"
];
const encodedText = await electronade.endecoder
.encode({ plainText, password, salt });
assert.equal(
await electronade.endecoder
.decode({ encodedText, password, salt }),
plainText
);