Answers for "amcryption npm package"

0

amcryption npm package

const amcryption = require('amcryption')

/*
-----------------------------------------------------------------------------------
-=-=-=-=-=-=-= Creating the instance of the Encoder and Decoder class-=-=-=-=-=-=-=
------------------------- For Simple Encoding and Decoding-------------------------
-----------------------------------------------------------------------------------
*/
const encoder = amcryption.getEncoder()
const decoder = amcryption.getDecoder()


/*
-----------------------------------------------------------------------------------
ENCODING THE DATA
*/
let encoded_string = encoder.encode('...put your string data here...')

// For Example,
let encoded_email = encoder.encode('[email protected]')
// Encoded value will be =>  bllNbFdPeElDSC56ekxvckNJQXpLbllNdkdFSEB6dkdFekxvdlBrbllNQXpLblhjdkdF

/*
-----------------------------------------------------------------------------------
DECODING THE DATA
*/
let decoded_string = decoder.decode('...put your encoded string data here...')

// For example,
let decoded_email = decoder.decode('bllNbFdPeElDSC56dkdFekxvdlBrbllNQXpLblhjdkdFSEB6bFphYk1Zblhj')
// Decoded value will be => [email protected]



/*
-----------------------------------------------------------------------------------
-=-=-=-=-=-=-=-=-=-= Creating the instance of the Crypto class-=-=-=-=-=-=-=-=-=-=
----------------- For encrypting and decrypting data using crypto-----------------
-----------------------------------------------------------------------------------
*/
const crypto = amcryption.getCrypto()

// For Encryption
let encrypted_text = crypto.encrypt('--Your Text--')

// For Decryption
let decrypted_text = crypto.decrypt('--Encrypted text--')
Posted by: Guest on July-17-2021

Browse Popular Code Answers by Language