@wintao/wintao-encrypt
v1.0.2
Published
元道内部加解密工具
Downloads
3
Readme
@wintao/wintao-encrypt
TODO: description
Usage
import WintaoEncrypt from '@wintao/wintao-encrypt';
const key = WintaoEncrypt.uuid(16, 16); // 密钥
const encryptUtil = new WintaoEncrypt.EncryptUtil({
key: key, // 密钥通过选项传入
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
});
const encrypted = encryptUtil.encrypt('hello', uuid); // 密钥通过参数传入
console.log(encrypted);
const decrypted = encryptUtil.decrypt(encrypted);
console.log(decrypted);
