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

1 md5

import CryptoJS from "crypto-js";

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

console.log(md5)

2 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)

猜你喜欢

转载自blog.csdn.net/qq_36658051/article/details/121905935