# tmgc-components

> ---接口加密解密算法

Latest version **1.0.9** (published 2021-03-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install tmgc-components
pnpm add tmgc-components
yarn add tmgc-components
bun add tmgc-components
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2021-03-25 |
| First published | 2021-03-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | dylan |
| Maintainers | zhouxuanyunpm, zxchen_ |

## Links

- npm: https://www.npmjs.com/package/tmgc-components
- Repository: git@gitlab.360tianma.com:zhouxuanyu/tm-components
- npm.io page: https://npm.io/package/tmgc-components

## Dependencies (1)

- [crypto-js](https://npm.io/package/crypto-js.md) ^4.0.0

## Recent versions

- 1.0.9 (latest) — 2021-03-25
- 1.0.5 — 2021-03-25
- 1.0.2 — 2021-03-25
- 1.0.0 — 2021-03-25

## README

## 前端js 组件&插件

### secret

---接口加密解密算法

使用方法：
```js
import { secret } from "tmgc-components";

// 需要加密的数据
const data = {a: 1, b: 2};

// 秘钥
const key = '1234567890123456';

// 偏移量
const iv = '1234567890123456';

// 加密方法
// JSON.stringify => aes加密
secret.encryption(config.data, key, iv)

// 解密方法
// base64解密 => aes解密 => JSON.parse
secret.decryption(res.data, key, iv)
```

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