1.1.0 • Published 2 years ago

ms.cryption v1.1.0

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

MicroService Cryption

The encryption and decryption service for Node.js exposure of GDS Digital Microservice Team

Install

npm install ms.cryption

Usage

// 引用已经下载的包
const { Microsoft } = require("ms.cryption");

/**
 * 实例化对象
 * params:string 调用digital微服务的服务地址
*/
let microsoft = new Microsoft(
  "https://china-assurance-microservice.xxxx.net:xxxx"
);

// 自己生成的UUID
let keyCore = "f70ad85d-872e-4dcd-a92b-0347ae67e9f4";

/**
 * 调用加密服务
 * param1: string 待加密字符
 * param2: string 自己生成的UUID
*/
microsoft.encryption("这是一个需要加密的字符串", keyCore).then((enRes) => {
    // enRes 即使加密后的返回结果
});

/**
 * 调用解密服务
 * param1: string 待解密字符
 * param2: string 自己生成的UUID (要与加密时相同)
*/
microsoft.decrypt(res, keyCore).then((deRes) => {
    // deRes 解密后的得道的结果
});

/**
 * 调用解密服务
 * param1: string 待解密Base64
 * param2: string 自己生成的UUID (要与加密时相同)
*/
microsoft.decryptFile(res, keyCore).then((fileRes) => {
    // fileRes 解密后的得道的结果
});
1.1.0

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago