GitHub Demo 地址:
jh-weapp-demo
實(shí)現(xiàn)一些常用效果、封裝通用組件和工具類
在微信小程序使用加密算法吟孙,需要對(duì)js中使用的對(duì)稱加密算法需要進(jìn)行改造澜倦,demo中對(duì)每一種加密方法進(jìn)行封裝,最終通過
encryptUtils.js
工具類進(jìn)行二次封裝杰妓,然后統(tǒng)一調(diào)用。源碼請(qǐng)查看demo
在這里插入圖片描述
在線AES網(wǎng)站 : https://tool.lmeee.com/jiami/aes
在線RSA網(wǎng)站 : https://www.bejson.com/enc/rsa/
用法:
const EncryptUtils = require('../../utils/encrypt/encryptUtils')
EncryptUtils.AESEncrypt('123')
EncryptUtils.RSAEncrypt('123')
EncryptUtils.SHA256('123')
EncryptUtils.MD5('123')
EncryptUtils.Base64EnCode('123')
EncryptUtils.Base64DeCode('123')