open-l2encdec 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -24
- package/dist/index.d.ts +0 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -26
- package/dist/index.js.map +1 -1
- package/package.json +4 -6
- package/dist/index.browser.d.ts +0 -23
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.browser.js +0 -48
- package/dist/index.browser.js.map +0 -1
- package/dist/index.node.d.ts +0 -23
- package/dist/index.node.d.ts.map +0 -1
- package/dist/index.node.js +0 -48
- package/dist/index.node.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,13 +3,10 @@
|
|
|
3
3
|
## Installation
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
# npm
|
|
7
6
|
$ npm install open-l2encdec
|
|
8
|
-
|
|
9
|
-
# yarn
|
|
7
|
+
# or
|
|
10
8
|
$ yarn add open-l2encdec
|
|
11
|
-
|
|
12
|
-
# pnpm
|
|
9
|
+
# or
|
|
13
10
|
$ pnpm add open-l2encdec
|
|
14
11
|
```
|
|
15
12
|
|
|
@@ -43,19 +40,6 @@ const { initL2EncDec, encode, decode, initParams } = require('open-l2encdec');
|
|
|
43
40
|
})();
|
|
44
41
|
```
|
|
45
42
|
|
|
46
|
-
### Direct WASM Module Access
|
|
47
|
-
|
|
48
|
-
You can also access the WASM module directly:
|
|
49
|
-
|
|
50
|
-
```typescript
|
|
51
|
-
import createModule from 'open-l2encdec/wasm';
|
|
52
|
-
|
|
53
|
-
const module = await createModule();
|
|
54
|
-
const params = new module.Params();
|
|
55
|
-
module.init_params(params, 111);
|
|
56
|
-
// ... use module directly
|
|
57
|
-
```
|
|
58
|
-
|
|
59
43
|
## API Reference
|
|
60
44
|
|
|
61
45
|
### Functions
|
|
@@ -106,12 +90,6 @@ Initializes default parameters for the specified protocol.
|
|
|
106
90
|
$ yarn build
|
|
107
91
|
```
|
|
108
92
|
|
|
109
|
-
### Development server
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
$ yarn dev
|
|
113
|
-
```
|
|
114
|
-
|
|
115
93
|
## License
|
|
116
94
|
|
|
117
95
|
MIT License - see [LICENSE](../../LICENSE) file for details.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeScript wrapper for l2encdec WASM module
|
|
3
|
-
*/
|
|
4
1
|
import type { MainModule, Params, Type, EncodeResult, DecodeResult } from "./l2encdec.js";
|
|
5
2
|
export type { MainModule as L2EncDecModule, Params, Type, EncodeResult, DecodeResult };
|
|
6
|
-
/**
|
|
7
|
-
* Initialize and return the l2encdec WASM module
|
|
8
|
-
*/
|
|
9
3
|
export declare function initL2EncDec(): Promise<MainModule>;
|
|
10
|
-
/**
|
|
11
|
-
* Encode data
|
|
12
|
-
*/
|
|
13
4
|
export declare function encode(input: Uint8Array | number[], params: Params, module?: MainModule): Promise<Uint8Array>;
|
|
14
|
-
/**
|
|
15
|
-
* Decode data
|
|
16
|
-
*/
|
|
17
5
|
export declare function decode(input: Uint8Array | number[], params: Params, module?: MainModule): Promise<Uint8Array>;
|
|
18
|
-
/**
|
|
19
|
-
* Initialize params
|
|
20
|
-
*/
|
|
21
6
|
export declare function initParams(protocol: number, filename?: string, use_legacy_decrypt_rsa?: boolean, module?: MainModule): Promise<Params>;
|
|
22
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,UAAU,IAAI,cAAc,EAC5B,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,YAAY,EACb,CAAC;AAYF,wBAAsB,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,CAExD;AAED,wBAAsB,MAAM,CAC1B,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,EAC5B,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED,wBAAsB,MAAM,CAC1B,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,EAC5B,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,sBAAsB,CAAC,EAAE,OAAO,EAChC,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,MAAM,CAAC,CAUjB"}
|
package/dist/index.js
CHANGED
|
@@ -1,49 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeScript wrapper for l2encdec WASM module
|
|
3
|
-
*/
|
|
4
|
-
// ---- internal module cache ----
|
|
5
1
|
let cachedModule;
|
|
6
|
-
// ---- internal loader ----
|
|
7
2
|
async function loadModule() {
|
|
8
3
|
if (cachedModule)
|
|
9
4
|
return cachedModule;
|
|
10
|
-
|
|
11
|
-
if (typeof window !== 'undefined' && typeof navigator !== 'undefined') {
|
|
12
|
-
// @ts-ignore - l2encdec.browser.js is generated during build
|
|
13
|
-
mod = await import("./l2encdec.browser.js");
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
// @ts-ignore - l2encdec.node.js is generated during build
|
|
17
|
-
mod = await import("./l2encdec.node.js");
|
|
18
|
-
}
|
|
5
|
+
const mod = await import("./l2encdec.js");
|
|
19
6
|
cachedModule = (await mod.default());
|
|
20
7
|
return cachedModule;
|
|
21
8
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Initialize and return the l2encdec WASM module
|
|
24
|
-
*/
|
|
25
9
|
export async function initL2EncDec() {
|
|
26
10
|
return loadModule();
|
|
27
11
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Encode data
|
|
30
|
-
*/
|
|
31
12
|
export async function encode(input, params, module) {
|
|
32
13
|
const m = module ?? await loadModule();
|
|
33
14
|
const result = m.encode(input, params);
|
|
34
15
|
return result instanceof Uint8Array ? result : new Uint8Array(result);
|
|
35
16
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Decode data
|
|
38
|
-
*/
|
|
39
17
|
export async function decode(input, params, module) {
|
|
40
18
|
const m = module ?? await loadModule();
|
|
41
19
|
const result = m.decode(input, params);
|
|
42
20
|
return result instanceof Uint8Array ? result : new Uint8Array(result);
|
|
43
21
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Initialize params
|
|
46
|
-
*/
|
|
47
22
|
export async function initParams(protocol, filename, use_legacy_decrypt_rsa, module) {
|
|
48
23
|
const m = module ?? await loadModule();
|
|
49
24
|
const params = new m.Params();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAgBA,IAAI,YAAoC,CAAC;AAEzC,KAAK,UAAU,UAAU;IACvB,IAAI,YAAY;QAAE,OAAO,YAAY,CAAC;IAEtC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;IAC1C,YAAY,GAAG,CAAC,MAAM,GAAG,CAAC,OAAO,EAAE,CAAe,CAAC;IACnD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,OAAO,UAAU,EAAE,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,KAA4B,EAC5B,MAAc,EACd,MAAmB;IAEnB,MAAM,CAAC,GAAG,MAAM,IAAI,MAAM,UAAU,EAAE,CAAC;IACvC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvC,OAAO,MAAM,YAAY,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,KAA4B,EAC5B,MAAc,EACd,MAAmB;IAEnB,MAAM,CAAC,GAAG,MAAM,IAAI,MAAM,UAAU,EAAE,CAAC;IACvC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvC,OAAO,MAAM,YAAY,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,QAAgB,EAChB,QAAiB,EACjB,sBAAgC,EAChC,MAAmB;IAEnB,MAAM,CAAC,GAAG,MAAM,IAAI,MAAM,UAAU,EAAE,CAAC;IACvC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,CAAC,CAAC,WAAW,CACX,MAAM,EACN,QAAQ,EACR,QAAQ,IAAI,EAAE,EACd,sBAAsB,IAAI,KAAK,CAChC,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-l2encdec",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "TypeScript/JavaScript bindings for open-l2encdec
|
|
3
|
+
"version": "0.0.13",
|
|
4
|
+
"description": "TypeScript/JavaScript bindings for open-l2encdec - Lineage 2 encryption library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -45,12 +45,10 @@
|
|
|
45
45
|
"wasm:build": "cd ../.. && cmake --preset emscripten && cmake --build --preset emscripten-build",
|
|
46
46
|
"wasm:copy": "node scripts/copy-wasm.js",
|
|
47
47
|
"ts:build": "npm run wasm:copy && tsc -p tsconfig.json",
|
|
48
|
-
"build": "npm run wasm:build && npm run ts:build"
|
|
49
|
-
"dev": "vite"
|
|
48
|
+
"build": "npm run wasm:build && npm run ts:build"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
51
|
"@types/node": "^25.0.3",
|
|
53
|
-
"typescript": "^5.3.0"
|
|
54
|
-
"vite": "^7.3.0"
|
|
52
|
+
"typescript": "^5.3.0"
|
|
55
53
|
}
|
|
56
54
|
}
|
package/dist/index.browser.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser-optimized entry point for l2encdec WASM module
|
|
3
|
-
* This version explicitly loads the browser WASM build
|
|
4
|
-
*/
|
|
5
|
-
import type { MainModule, Params, Type, EncodeResult, DecodeResult } from "./l2encdec.js";
|
|
6
|
-
export type { MainModule as L2EncDecModule, Params, Type, EncodeResult, DecodeResult };
|
|
7
|
-
/**
|
|
8
|
-
* Initialize and return the l2encdec WASM module
|
|
9
|
-
*/
|
|
10
|
-
export declare function initL2EncDec(): Promise<MainModule>;
|
|
11
|
-
/**
|
|
12
|
-
* Encode data
|
|
13
|
-
*/
|
|
14
|
-
export declare function encode(input: Uint8Array | number[], params: Params, module?: MainModule): Promise<Uint8Array>;
|
|
15
|
-
/**
|
|
16
|
-
* Decode data
|
|
17
|
-
*/
|
|
18
|
-
export declare function decode(input: Uint8Array | number[], params: Params, module?: MainModule): Promise<Uint8Array>;
|
|
19
|
-
/**
|
|
20
|
-
* Initialize params
|
|
21
|
-
*/
|
|
22
|
-
export declare function initParams(protocol: number, filename?: string, use_legacy_decrypt_rsa?: boolean, module?: MainModule): Promise<Params>;
|
|
23
|
-
//# sourceMappingURL=index.browser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../index.browser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,YAAY,EACb,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,UAAU,IAAI,cAAc,EAC5B,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,YAAY,EACb,CAAC;AAiBF;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,CAExD;AAED;;GAEG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,EAC5B,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;GAEG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,EAC5B,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;GAEG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,sBAAsB,CAAC,EAAE,OAAO,EAChC,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,MAAM,CAAC,CAUjB"}
|
package/dist/index.browser.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser-optimized entry point for l2encdec WASM module
|
|
3
|
-
* This version explicitly loads the browser WASM build
|
|
4
|
-
*/
|
|
5
|
-
// ---- internal module cache ----
|
|
6
|
-
let cachedModule;
|
|
7
|
-
// ---- internal loader - always uses browser version ----
|
|
8
|
-
async function loadModule() {
|
|
9
|
-
if (cachedModule)
|
|
10
|
-
return cachedModule;
|
|
11
|
-
// Load the browser-optimized WASM module
|
|
12
|
-
// @ts-ignore - l2encdec.browser.js is generated during build
|
|
13
|
-
const mod = await import("./l2encdec.browser.js");
|
|
14
|
-
cachedModule = (await mod.default());
|
|
15
|
-
return cachedModule;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Initialize and return the l2encdec WASM module
|
|
19
|
-
*/
|
|
20
|
-
export async function initL2EncDec() {
|
|
21
|
-
return loadModule();
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Encode data
|
|
25
|
-
*/
|
|
26
|
-
export async function encode(input, params, module) {
|
|
27
|
-
const m = module ?? await loadModule();
|
|
28
|
-
const result = m.encode(input, params);
|
|
29
|
-
return result instanceof Uint8Array ? result : new Uint8Array(result);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Decode data
|
|
33
|
-
*/
|
|
34
|
-
export async function decode(input, params, module) {
|
|
35
|
-
const m = module ?? await loadModule();
|
|
36
|
-
const result = m.decode(input, params);
|
|
37
|
-
return result instanceof Uint8Array ? result : new Uint8Array(result);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Initialize params
|
|
41
|
-
*/
|
|
42
|
-
export async function initParams(protocol, filename, use_legacy_decrypt_rsa, module) {
|
|
43
|
-
const m = module ?? await loadModule();
|
|
44
|
-
const params = new m.Params();
|
|
45
|
-
m.init_params(params, protocol, filename ?? "", use_legacy_decrypt_rsa ?? false);
|
|
46
|
-
return params;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=index.browser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../index.browser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoBH,kCAAkC;AAClC,IAAI,YAAoC,CAAC;AAEzC,0DAA0D;AAC1D,KAAK,UAAU,UAAU;IACvB,IAAI,YAAY;QAAE,OAAO,YAAY,CA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CACX,MAAM,EACN,QAAQ,EACR,QAAQ,IAAI,EAAE,EACd,sBAAsB,IAAI,KAAK,CAChC,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/index.node.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node.js-optimized entry point for l2encdec WASM module
|
|
3
|
-
* This version explicitly loads the Node.js WASM build
|
|
4
|
-
*/
|
|
5
|
-
import type { MainModule, Params, Type, EncodeResult, DecodeResult } from "./l2encdec.js";
|
|
6
|
-
export type { MainModule as L2EncDecModule, Params, Type, EncodeResult, DecodeResult };
|
|
7
|
-
/**
|
|
8
|
-
* Initialize and return the l2encdec WASM module
|
|
9
|
-
*/
|
|
10
|
-
export declare function initL2EncDec(): Promise<MainModule>;
|
|
11
|
-
/**
|
|
12
|
-
* Encode data
|
|
13
|
-
*/
|
|
14
|
-
export declare function encode(input: Uint8Array | number[], params: Params, module?: MainModule): Promise<Uint8Array>;
|
|
15
|
-
/**
|
|
16
|
-
* Decode data
|
|
17
|
-
*/
|
|
18
|
-
export declare function decode(input: Uint8Array | number[], params: Params, module?: MainModule): Promise<Uint8Array>;
|
|
19
|
-
/**
|
|
20
|
-
* Initialize params
|
|
21
|
-
*/
|
|
22
|
-
export declare function initParams(protocol: number, filename?: string, use_legacy_decrypt_rsa?: boolean, module?: MainModule): Promise<Params>;
|
|
23
|
-
//# sourceMappingURL=index.node.d.ts.map
|
package/dist/index.node.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../index.node.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,YAAY,EACb,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,UAAU,IAAI,cAAc,EAC5B,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,YAAY,EACb,CAAC;AAiBF;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,CAExD;AAED;;GAEG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,EAC5B,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;GAEG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,EAC5B,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;GAEG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,sBAAsB,CAAC,EAAE,OAAO,EAChC,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,MAAM,CAAC,CAUjB"}
|
package/dist/index.node.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node.js-optimized entry point for l2encdec WASM module
|
|
3
|
-
* This version explicitly loads the Node.js WASM build
|
|
4
|
-
*/
|
|
5
|
-
// ---- internal module cache ----
|
|
6
|
-
let cachedModule;
|
|
7
|
-
// ---- internal loader - always uses node version ----
|
|
8
|
-
async function loadModule() {
|
|
9
|
-
if (cachedModule)
|
|
10
|
-
return cachedModule;
|
|
11
|
-
// Load the Node.js-optimized WASM module
|
|
12
|
-
// @ts-ignore - l2encdec.node.js is generated during build
|
|
13
|
-
const mod = await import("./l2encdec.node.js");
|
|
14
|
-
cachedModule = (await mod.default());
|
|
15
|
-
return cachedModule;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Initialize and return the l2encdec WASM module
|
|
19
|
-
*/
|
|
20
|
-
export async function initL2EncDec() {
|
|
21
|
-
return loadModule();
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Encode data
|
|
25
|
-
*/
|
|
26
|
-
export async function encode(input, params, module) {
|
|
27
|
-
const m = module ?? await loadModule();
|
|
28
|
-
const result = m.encode(input, params);
|
|
29
|
-
return result instanceof Uint8Array ? result : new Uint8Array(result);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Decode data
|
|
33
|
-
*/
|
|
34
|
-
export async function decode(input, params, module) {
|
|
35
|
-
const m = module ?? await loadModule();
|
|
36
|
-
const result = m.decode(input, params);
|
|
37
|
-
return result instanceof Uint8Array ? result : new Uint8Array(result);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Initialize params
|
|
41
|
-
*/
|
|
42
|
-
export async function initParams(protocol, filename, use_legacy_decrypt_rsa, module) {
|
|
43
|
-
const m = module ?? await loadModule();
|
|
44
|
-
const params = new m.Params();
|
|
45
|
-
m.init_params(params, protocol, filename ?? "", use_legacy_decrypt_rsa ?? false);
|
|
46
|
-
return params;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=index.node.js.map
|
package/dist/index.node.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.node.js","sourceRoot":"","sources":["../index.node.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoBH,kCAAkC;AAClC,IAAI,YAAoC,CAAC;AAEzC,uDAAuD;AACvD,KAAK,UAAU,UAAU;IACvB,IAAI,YAAY;QAAE,OAAO,YAAY,CAAC;IAEtC,yCAAyC;IACzC,0DAA0D;IAC1D,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAC/C,YAAY,GAAG,CAAC,MAAM,GAAG,CAAC,OAAO,EAAE,CAAe,CAAC;IAEnD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,OAAO,UAAU,EAAE,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,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