天天看点

使用 crypto.js 进行md5、base64加密

md5

import CryptoJS from "crypto-js";

const password = "1234qwer"; 
const md5 = CryptoJS.MD5(password).toString();

console.log(md5)      

base64

import CryptoJS from "crypto-js";

const password = "1234qwer"; 
const utf8= CryptoJS.enc.Utf8.parse(password);
const base64 = CryptoJS.enc.Base64.stringify(utf8);

console.log(md5)      

继续阅读