# eroad-oauth2-encryption

> encrypt or decrypt for eroad

Latest version **0.0.5** (published 2017-05-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install eroad-oauth2-encryption
pnpm add eroad-oauth2-encryption
yarn add eroad-oauth2-encryption
bun add eroad-oauth2-encryption
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2017-05-23 |
| First published | 2017-05-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sakura |
| Maintainers | sakura_ |

## Links

- npm: https://www.npmjs.com/package/eroad-oauth2-encryption
- npm.io page: https://npm.io/package/eroad-oauth2-encryption

## Recent versions

- 0.0.5 (latest) — 2017-05-23
- 0.0.4 — 2017-05-23
- 0.0.2 — 2017-05-23
- 0.0.1 — 2017-05-23

## README

## 加解密插件

#### 安装
```
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);
```

---
_Source: https://npm.io/package/eroad-oauth2-encryption · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
