常用的库

// 模块排序库
http://www.sortablejs.com/index.html

// 加密解密
// npm 依赖  crypto-es
import CryptoES  from ‘crypto-es‘

 const keyStr = ‘eSEdSfdED==WGDH‘
 // 加密
 export function encrypt(word:string) {
   const key = CryptoES .enc.Utf8.parse(keyStr)
   const srcs = CryptoES .enc.Utf8.parse(word)
   const encrypted = CryptoES .AES.encrypt(srcs, key, { mode: CryptoES .mode.ECB, padding: CryptoES .pad.Pkcs7 })
   return encrypted.toString()
 }

 // 解密
 export function decrypt(word:string) {
   const key = CryptoES .enc.Utf8.parse(keyStr)
   const decryptStr = CryptoES .AES.decrypt(word, key, { mode: CryptoES .mode.ECB, padding: CryptoES .pad.Pkcs7 })
   return CryptoES .enc.Utf8.stringify(decryptStr).toString()
 }

 export default {encrypt ,decrypt}

  

常用的库

上一篇:安装PHPStudy2014,打开端口出现80端口 PID4 进程:System-windows服务器应用


下一篇:Linux系统启动流程