2021-12-19 18:19:25 +00:00
|
|
|
|
# JOOX-Crypto
|
|
|
|
|
|
2021-12-19 21:02:17 +00:00
|
|
|
|
Joox 加密处理库。
|
|
|
|
|
|
|
|
|
|
支持的加密版本:
|
|
|
|
|
|
|
|
|
|
- `E!04` - 加密版本 v4
|
|
|
|
|
|
|
|
|
|
## 安装 & 使用 (Install & Usage)
|
|
|
|
|
|
2024-09-29 17:25:12 +00:00
|
|
|
|
在项目目录加入 `.npmrc`:
|
|
|
|
|
|
|
|
|
|
```ini
|
|
|
|
|
@unlock-music:registry=https://git.unlock-music.dev/api/packages/um/npm/
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
然后安装:
|
|
|
|
|
|
2021-12-19 21:02:17 +00:00
|
|
|
|
```sh
|
2021-12-20 17:36:20 +00:00
|
|
|
|
npm i --save @unlock-music/joox-crypto
|
2021-12-19 21:02:17 +00:00
|
|
|
|
```
|
|
|
|
|
|
2024-09-29 17:25:12 +00:00
|
|
|
|
使用:
|
|
|
|
|
|
2021-12-19 21:02:17 +00:00
|
|
|
|
```js
|
|
|
|
|
const jooxFactory = require('@unlock-music-gh/joox-crypto');
|
|
|
|
|
|
|
|
|
|
const data = new Uint8Array(...);
|
|
|
|
|
const decryptor = jooxFactory(data, '00000000000000000000000000000000');
|
|
|
|
|
if (!decryptor) throw new Error('不支持的加密方案或不是 joox 加密的文件。');
|
|
|
|
|
|
|
|
|
|
/** @type {Uint8Array[]} */
|
|
|
|
|
const decrypted = decryptor.decryptFile(data);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## English
|
|
|
|
|
|
2021-12-19 18:19:25 +00:00
|
|
|
|
A package to decrypt joox encrypted file.
|
|
|
|
|
|
|
|
|
|
Supported varient:
|
|
|
|
|
|
|
|
|
|
- `E!04` - encryption ver 4
|