美文网首页小程序
微信小程序 - AES、RSA、SHA256、MD5、base6

微信小程序 - AES、RSA、SHA256、MD5、base6

作者: 西半球_ | 来源:发表于2021-08-28 16:47 被阅读0次

    GitHub Demo 地址: jh-weapp-demo 实现一些常用效果、封装通用组件和工具类

    在微信小程序使用加密算法,需要对js中使用的对称加密算法需要进行改造,demo中对每一种加密方法进行封装,最终通过encryptUtils.js 工具类进行二次封装,然后统一调用。源码请查看demo

    在这里插入图片描述

    在线AES网站 : https://tool.lmeee.com/jiami/aes
    在线RSA网站 : 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')
    

    相关文章

      网友评论

        本文标题:微信小程序 - AES、RSA、SHA256、MD5、base6

        本文链接:https://www.haomeiwen.com/subject/crtstltx.html