@tomsd/ekey
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

@tomsd/ekey

Installation

npm install @tomsd/ekey

Usage

// with bundler...
import ekey from "@tomsd/ekey";
// node.js
const ekey = require("@tomsd/ekey");
// initialize key with seed string
const testkey1 = ekey.activate("testkey1");
const testkey2 = ekey.activate("testkey2");

const text = "This is a test!";

// encode
const encoded1 = testkey1.encode(text);
const encoded2 = testkey2.encode(text);

console.log(encoded1);
console.log(encoded2);

// decode
const decoded1 = testkey1.decode(encoded1);
const decoded2 = testkey1.decode(encoded2);

console.log(decoded1);
console.log(deccoded2);

// decoding fails if the seeds are different from each other
console.log(testkey2.decode(encoded1));
console.log(testkey1.decode(encoded2));

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.0.02latest

Version History

VersionDownloads (Last 7 Days)Published
4.0.02
3.0.00
2.0.00
1.0.00

Package Sidebar

Install

npm i @tomsd/ekey

Weekly Downloads

2

Version

4.0.0

License

MIT

Unpacked Size

8.32 kB

Total Files

8

Last publish

Collaborators

  • tomsd