# primary-crypto

> primary crypto

Latest version **0.0.3** (published 2020-01-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install primary-crypto
pnpm add primary-crypto
yarn add primary-crypto
bun add primary-crypto
```

## 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.3 |
| Published | 2020-01-03 |
| First published | 2020-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 37.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wanglihui |
| Maintainers | wlh |

## Links

- npm: https://www.npmjs.com/package/primary-crypto
- Repository: git@gitlab.yc345.tv:backend/primary-crypto
- npm.io page: https://npm.io/package/primary-crypto

## Dependencies (1)

- [md5](https://npm.io/package/md5.md) ^2.2.1

## Recent versions

- 0.0.3 (latest) — 2020-01-03

## README

# primary-crypto

小学登录、注册加密

### 使用
---

```shell
    # 洋葱内部模块需要先设置本地 npmrc 为洋葱私有npm仓库。 npm config set registry https://npm.yc345.tv  && npm login 
    npm install @guanghe/primary-crypto
    #yarn add @guanghe/primary-crypto
    
```

- 加密

```javascript
    import {encrypto} from '@guanghe/primary-crypto'
    let phone = '15512341234';
    let pwd = '123456';
    let sign = encrypto(phone, pwd);
    //使用sign作为密码传给服务服务器
```

- 解密

```
    import {decrypt} from '@guanghe/primary-crypto'
    let {phone, pwd, timestamp} = decrypt(sign);
    //pwd是md5签名的HASH 值 全大写
```

- 验证

```
   import {decrypt} from '@guanghe/primary-crypto'
   let sign = '接收到的sign';
   let phone = '15512341234';
   let pwd = '123456';
   let b = verify(sign, phone, pwd);
   // 验证成功返回 true,失败返回 false
```

### 测试 

- npx mocha

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