Encrypt.js
455 Bytes
const CryptoJS = require("crypto-js");
function createHashed(str) {
var hash = CryptoJS.SHA256(str);
console.log("암호화된 값 : " + hash);
// base64
// var key = CryptoJS.enc.Utf8.parse(str);
// var base64 = CryptoJS.enc.Base64.stringify(key); //encoded
// var decrypt = CryptoJS.enc.Base64.parse(base64);
// var hashData = decrypt.toString(CryptoJS.enc.Utf8); //decoded
}
createHashed("Happy2468!");
module.exports = createHashed;