0.0.5 • Published 7 years ago

eroad-oauth2-encryption v0.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

加解密插件

安装

npm i eroad-oauth2-encryption --save

使用方法

const cipher = require('eroad-oauth2-encryption');

// 需要加密的数据
let data = {
    "code": 0,
    "msg": "OK",
    "data": {
        "data": "测试数据"
    }
};

// 秘钥 通过api/oauth2/oauth2_token接口获取token,将token作为秘钥
let token = '1e7e62a3f2f84831b7428bf078f9015c';

// 标记 使用appid作为标记
let appid = '5628278295749946';

// 加密
let en = cipher.encrypt(data, token, appid);

// 解密
let de = cipher.decrypt(en, token, appid);
0.0.5

7 years ago

0.0.4

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago