import cryptoJS from 'crypto-js';
方法:
getMd5Base64(input: string, key: string | cryptoJS.WordArray): string {
const test = cryptoJS.HmacSHA256(input, key);
return test.toString(cryptoJS.enc.Base64);
}
使用:
console.warn('====== test:' + this.getMd5Base64('sunny=123456', 'sunny'));
网友评论