// USAGE
/*
const { md5, hash, encrypt, decrypt } = require('criptonita');
*/
const criptonita = require('criptonita');
const md5 = criptonita.md5('string to md5');
// Return: md5 string. Type: HEX
const hash = criptonita.hash('string to hash sha256', 'password');
// Return: encrypted hash string (sha256). Type: HEX
const encrypted = criptonita.encrypt('string to encrypt', 'password', 'optional salt');
// Return: encrypted string. Type: HEX
const decrypted = criptonita.decrypt(encrypted, 'password', 'optional salt');
// Return: decrypted string. if return is null, password wrong or invalid encryption.
console.log({ md5, hash, encrypted, decrypted });
/* RESULT:
{
md5: '6932692e9e37c56334906bc60e02a621',
hash: '332e5608f6bf116b94c0a4ddbe8916e652b147b67f6c4b5e9fec2d7faeb526b1',
encrypted: 'dc7d59eb9cde4e1941a2e6039bb2b2add01a4729b4e3644c537f1a5c05a7cb0c',
decrypted: 'string to encrypt'
}
*/