@mhs003/scrypt
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

SCrypt

scrypt does simple text encoding/decoding.

The algorithm will generate a new encoded string for given text in each running time.

install

With npm do:

npm i @mhs003/scrypt

After installation, include the module in main file,

const scrypt = require('@mhs003/scrypt');

methods

scrypt has three methods, encode, decode and escapes, which both take a single argument.

  • encode - Takes regular string and returns an encoded string
  • decode - Takes an encoded string and returns it's decoded regular string
  • escapes - Adds an escape character (\) before all \, ' and "

Examples

Encode

scrypt.encode('Hello World');
// Returns: ?461<3,5,9%8.2h3%9v5,1}4$
// or something else...

Decode

scrypt.decode('?461<3,5,9%8.2h3%9v5,1}4$');
// Returns: Hello World

Escapes

let enc = scrypt.encode('Hello World');
console.log(enc);
    // Output: ?4j7x1\1\3>8"4=7>1a1\5w6$
console.log(scrypt.escapes(enc));
    // Output: ?4j7x1\\1\\3>8\"4=7>1a1\\5w6$

Ques.

  • Why this does exists? - Don't know :p Created just for fun.
  • Why should I use? - You don't have to :b

Readme

Keywords

Package Sidebar

Install

npm i @mhs003/scrypt

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

4.49 kB

Total Files

5

Last publish

Collaborators

  • mhs003