A simple, tiny wrapper around some useful NodeJS crypto functions.
npm install @component-tree/crypto-utils
npm i -S @component-tree/crypto-utils
`$3
`javascript
const cryptoUtils = require('@component-tree/crypto-utils');const key = 'This has to bE thirty-tw0 chars!';
/ ENCRYPT (Uses aes-256-cbc)/
const encrypted = cryptoUtils.encrypt(key, 'This is some text to encrypt');
/ DECRYPT /
const decrypted = cryptoUtils.decrypt(key, encrypted);
console.log(decrypted);
/ HASH FUNCTIONS /
const str = 'This will be hashed';
const md5Hash = cryptoUtils.md5(str);
const sha1 = cryptoUtils.sha1(str);
const sha256 = cryptoUtils.sha256(str);
``