# qiao-encode

> nodejs crypto tool

Latest version **5.0.6** (published 2025-12-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install qiao-encode
pnpm add qiao-encode
yarn add qiao-encode
bun add qiao-encode
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 5.0.6 |
| Published | 2025-12-23 |
| First published | 2022-05-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 27 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | uikoo9 |
| Maintainers | npm_insistime |
| Keywords | nodejs, crypto, tool, aes, 3des, uuid, random, md5 |

## Links

- npm: https://www.npmjs.com/package/qiao-encode
- Repository: https://github.com/uikoo9/qiao-nodejs
- Homepage: https://code.vincentqiao.com/#qiao-encode
- Issues: https://github.com/uikoo9/qiao-nodejs/issues
- npm.io page: https://npm.io/package/qiao-encode

## Dependencies (1)

- [uuid](https://npm.io/package/uuid.md) ^13.0.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 5.0.6 (latest) — 2025-12-23
- 5.0.5 — 2025-12-23
- 5.0.1 — 2025-09-18
- 5.0.0 — 2025-07-25
- 4.9.4 — 2025-03-18
- 4.7.4 — 2024-12-05
- 4.7.2 — 2024-12-04
- 4.7.1 — 2024-12-04
- 4.5.1 — 2024-03-07
- 4.4.2 — 2024-02-17
- 4.3.0 — 2023-11-15
- 4.2.6 — 2023-11-14
- 4.1.1 — 2023-10-09
- 4.0.0 — 2023-10-05
- 3.2.6 — 2023-09-28
- … 23 more at https://npm.io/package/qiao-encode/versions

## README

## qiao-encode

[![npm version](https://img.shields.io/npm/v/qiao-encode.svg?style=flat-square)](https://www.npmjs.org/package/qiao-encode)
[![npm downloads](https://img.shields.io/npm/dm/qiao-encode.svg?style=flat-square)](https://npm-stat.com/charts.html?package=qiao-encode)

nodejs 下加密，随机等能力

## install

安装

```shell
npm i qiao-encode
```

## use

使用

```javascript
// cjs
const { md5 } = require('qiao-encode');

// mjs
import { md5 } from 'qiao-encode';
```

## api

### md5

md5

- data
  - 类型: string
  - 说明: 内容
- encoding
  - 类型: string
  - 说明: 编码，'base64', 'hex', 默认为 base64
- return
  - 类型: string
  - 说明: 结果

```javascript
// md5
md5(data);

// md5, encoding
md5(data, encoding);
```

### uuid

uuid

- version
  - 类型: number
  - 说明: uuid 版本，1，3，4，5，默认为 4
- return
  - 类型: string
  - 说明: 结果

```javascript
// uuid, default
uuid();

// uuid, version
uuid(version);
```

### aes

aes

- data
  - 类型: string
  - 说明: 待加密或解密内容
- key
  - 类型: string
  - 说明: 秘钥
- iv
  - 类型: string
  - 说明: iv，默认为空
- encoding
  - 类型: string
  - 说明: 编码，默认为 base64
- return
  - 类型: string
  - 说明: 结果

```javascript
// encrypt
AESEncrypt(data, key);

// decrypt
AESDecrypt(data, key);

// iv, encoding
AESEncrypt(data, key, iv, encoding);
AESDecrypt(data, key, iv, encoding);
```

### 3des

3des

- data
  - 类型: string
  - 说明: 待加密或解密内容
- key
  - 类型: string
  - 说明: 秘钥
- iv
  - 类型: string
  - 说明: iv，默认为空
- encoding
  - 类型: string
  - 说明: 编码，默认为 base64
- return
  - 类型: string
  - 说明: 结果

```javascript
// tdes, default
TDESEncrypt(data, key);
TDESDecrypt(data, key);

// tdes, iv, encoding
TDESEncrypt(data, key, iv, encoding);
TDESDecrypt(data, key, iv, encoding);
```

### random

随机数字，字母等

```javascript
// random number
randomNumber(length);

// random lower letter
randomLetterLower(length);

// random upper letter
randomLetterUpper(length);

// random all letter
randomLetterAll(length);

// random all letter and number
randomLetterNumber(length);

// random seed
randomSeed(seed, length);

// random by seed
randomBySeed(seed);

// random in
randomIn(min, max);
```

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