unitiweb-crypter

1.0.2 • Public • Published

Build Status Coverage Status js-standard-style

unitiweb-crypter

This is a class that will encrypt, decrypt, and encode strings. Currently it uses cryptr to handle the encryption.

How to use

Install Package

To install the package you would run this code

npm install unitiweb-crypter

Instantiate Class

Library for encrypting, decrypting and encoding strings.

// A random secret key
const secret = 'abc123def456(@%';

// Instantiate the class
const crypter = new Crypter(secret);

Using the Class

Here's how you use the class to encrypt, decrypt, and encode

// Setup the class
const secret = 'abc123def456(@%'
const crypter = new Crypter(secret)

// The string
const myString = 'This is a test'

// Encrypt a string
const myStringEncrypted = crypter.encode(myString)

// Decrypt a string
const myStringDecrypted = crypter.decrypt(myStringEncrypted)

// SHA256 encode a string
const encodedString = crypter.sha256(myString)

/unitiweb-crypter/

    Package Sidebar

    Install

    npm i unitiweb-crypter

    Weekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    13.9 kB

    Total Files

    13

    Last publish

    Collaborators

    • unitiweb