安装

npm install gm-crypt 

引用

const SM4 = require('gm-crypt').sm4
let sm4Config = {
    key: 'KacLKDJkljasf89f',
    mode: 'cbc', // default
    iv: 'JSLKJFJLKFsdfass', // default is null
    // optional: this is the cipher data's type; Can be 'base64' or 'text'
    cipherType: 'base64' // default is base64
}
let sm4 = new SM4(sm4Config)

export  default {
    sm4
}
Logo

前往低代码交流专区

更多推荐