# mb-storage

> uni-app 移动端缓存包

Latest version **1.0.3** (published 2021-12-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install mb-storage
pnpm add mb-storage
yarn add mb-storage
bun add mb-storage
```

## 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.3 |
| Published | 2021-12-13 |
| First published | 2021-12-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | zhang_wei |

## Links

- npm: https://www.npmjs.com/package/mb-storage
- npm.io page: https://npm.io/package/mb-storage

## Dependencies (1)

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

## Recent versions

- 1.0.3 (latest) — 2021-12-13
- 1.0.2 — 2021-12-13
- 1.0.1 — 2021-12-13
- 1.0.0 — 2021-12-13

## README

## API 
#### Encrypt(data, params)

> 加密

| 参数 | 类型   | 必填 | 说明                   |
| ---- | ------ | ---- | ---------------------- |
| data  | String | 是   | 加密数据 |

**Params 参数说明**

| 参数 | 类型   | 必填 | 说明                   |
| ---- | ------ | ---- | ---------------------- |
| key  | String | 否   | 十六位作为密钥 |
| iv  | String | 否   | 十六位作为密钥偏移量 |

#### Decrypt(data, params)

> 解密

| 参数 | 类型   | 必填 | 说明                   |
| ---- | ------ | ---- | ---------------------- |
| data  | String | 是   | 加密数据 |

**Params 参数说明**
| 参数 | 类型   | 必填 | 说明                   |
| ---- | ------ | ---- | ---------------------- |
| key  | String | 否   | 十六位作为密钥（加密key对应） |
| iv  | String | 否   | 十六位作为密钥偏移量（加密iv对应） |

#### setLocal(key, params)

> 将 data 存储在本地缓存中指定的 key 中。

| 参数 | 类型   | 必填 | 说明                   |
| ---- | ------ | ---- | ---------------------- |
| key  | String | 是   | 本地缓存中的指定的 key |

**Params 参数说明**
| 参数 | 类型   | 必填 | 说明                   |
| ---- | ------ | ---- | ---------------------- |
| data  | Any | 是  | 本地缓存的内容 |
| expireTime  | String | 否   | 缓存过期时间（默认永久） |
| storageKey  | String | 否   | 十六位作为加密密钥） |
| storageIv  | String | 否   | 十六位作为密钥加密偏移量 |

#### getLocal(key, params)

> 根据key，获取本地缓存数据。

| 参数 | 类型   | 必填 | 说明                   |
| ---- | ------ | ---- | ---------------------- |
| key  | String | 是   | 本地缓存中的指定的 key |

**Params 参数说明**
| 参数 | 类型   | 必填 | 说明                   |
| ---- | ------ | ---- | ---------------------- |
| storageKey  | String | 否   | 十六位作为加密密钥） |
| storageIv  | String | 否   | 十六位作为密钥加密偏移量 |

#### clearLocal(key)

> 根据key，删除本都指定缓存。

| 参数 | 类型   | 必填 | 说明                   |
| ---- | ------ | ---- | ---------------------- |
| key  | String | 是   | 本地缓存中的指定的 key |


#### clearAllLocal()

> 删除所有本地缓存数据。


#### isIos()

> 判断当前机型是否是ios。


#### identityIDCard(code)

> 验证身份证号码

| 参数 | 类型   | 必填 | 说明                   |
| ---- | ------ | ---- | ---------------------- |
| code  | [String, Number] | 是   |  |


#### checkName(name)

> 验证姓名

| 参数 | 类型   | 必填 | 说明                   |
| ---- | ------ | ---- | ---------------------- |
| code  | String | 是   |  |


#### testPaycard(bankno)

> 验证银行卡号

| 参数 | 类型   | 必填 | 说明                   |
| ---- | ------ | ---- | ---------------------- |
| code  | [String, Number] | 是   |  |

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