1.0.1 • Published 2 years ago

basic-cipher v1.0.1

Weekly downloads
7
License
GPL-3.0
Repository
github
Last release
2 years ago

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'}
1.0.1

2 years ago

1.0.0

4 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago