basic-cipher

1.0.1 • Public • Published

Basic Cipher

npm version install size npm downloads

npm package for encoding and decoding text containing alphanumeric characters

Example

Encode

var Cipher = require('basic-cipher');

var key = 'Hello Word!';

var mySecretText = Cipher.encode('This is a secret message', key);

console.log(mySecretText);
// '*****encode message*****'

Decode

var Cipher = require('basic-cipher');

var key = 'Hello Word!';

var myText = Cipher.decode('*****encode message*****', key);

console.log(myText);
// 'This is a secret message'

Encode JSON

var Cipher = require('basic-cipher');

var key = 'Hello Word!';
var myJSON = {
    text: 'This is a secret message'
};

var mySecretText = Cipher.encodeJSON(myJSON, key);

console.log(mySecretText);
// '*****encode message*****'

Decode JSON

var Cipher = require('basic-cipher');

var key = 'Hello Word!';

var myText = Cipher.decodeJSON('*****encode json*****', key);

console.log(myText);
// {'text':'This is a secret message'}

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i basic-cipher

    Weekly Downloads

    5

    Version

    1.0.1

    License

    GPL-3.0

    Unpacked Size

    41.2 kB

    Total Files

    14

    Last publish

    Collaborators

    • donnici