open-l2encdec 0.0.19 → 0.0.21
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 +9 -3
- package/dist/l2encdec.browser.js +0 -0
- package/dist/l2encdec.js.d.ts +8 -1
- package/dist/l2encdec.node.js +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,12 +8,12 @@ $ npm install open-l2encdec
|
|
|
8
8
|
$ yarn add open-l2encdec
|
|
9
9
|
# or
|
|
10
10
|
$ pnpm add open-l2encdec
|
|
11
|
+
# or
|
|
12
|
+
$ bun add open-l2encdec
|
|
11
13
|
```
|
|
12
14
|
|
|
13
15
|
## Usage
|
|
14
16
|
|
|
15
|
-
### TypeScript / ES Modules
|
|
16
|
-
|
|
17
17
|
```typescript
|
|
18
18
|
// node
|
|
19
19
|
import { initL2EncDec, encode, decode, initParams } from 'open-l2encdec';
|
|
@@ -69,12 +69,18 @@ Initializes default parameters for the specified protocol.
|
|
|
69
69
|
- [CMake](https://cmake.org/) >= 3.14
|
|
70
70
|
- [Emscripten](https://emscripten.org/) >= 4.0.21
|
|
71
71
|
- [Node.js](https://nodejs.org/) >= v22
|
|
72
|
-
- [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/)
|
|
72
|
+
- [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/), [pnpm](https://pnpm.io/) or [bun](https://bun.sh/)
|
|
73
73
|
|
|
74
74
|
### Building
|
|
75
75
|
|
|
76
76
|
```bash
|
|
77
|
+
$ npm run build
|
|
78
|
+
# or
|
|
77
79
|
$ yarn build
|
|
80
|
+
# or
|
|
81
|
+
$ pnpm build
|
|
82
|
+
# or
|
|
83
|
+
$ bun run build
|
|
78
84
|
```
|
|
79
85
|
|
|
80
86
|
## License
|
package/dist/l2encdec.browser.js
CHANGED
|
Binary file
|
package/dist/l2encdec.js.d.ts
CHANGED
|
@@ -27,6 +27,11 @@ export interface DecodeResultValue<T extends number> {
|
|
|
27
27
|
}
|
|
28
28
|
export type DecodeResult = DecodeResultValue<0>|DecodeResultValue<-1>|DecodeResultValue<-2>|DecodeResultValue<-3>;
|
|
29
29
|
|
|
30
|
+
export interface ChecksumResultValue<T extends number> {
|
|
31
|
+
value: T;
|
|
32
|
+
}
|
|
33
|
+
export type ChecksumResult = ChecksumResultValue<0>|ChecksumResultValue<-1>;
|
|
34
|
+
|
|
30
35
|
export interface Params extends ClassHandle {
|
|
31
36
|
type: Type;
|
|
32
37
|
protocol: number;
|
|
@@ -54,10 +59,12 @@ interface EmbindModule {
|
|
|
54
59
|
Type: {NONE: TypeValue<0>, XOR: TypeValue<1>, XOR_FILENAME: TypeValue<2>, XOR_POSITION: TypeValue<3>, BLOWFISH: TypeValue<4>, RSA: TypeValue<5>};
|
|
55
60
|
EncodeResult: {SUCCESS: EncodeResultValue<0>, INVALID_TYPE: EncodeResultValue<-1>, COMPRESSION_FAILED: EncodeResultValue<-2>, ENCRYPTION_FAILED: EncodeResultValue<-3>};
|
|
56
61
|
DecodeResult: {SUCCESS: DecodeResultValue<0>, INVALID_TYPE: DecodeResultValue<-1>, DECOMPRESSION_FAILED: DecodeResultValue<-2>, DECRYPTION_FAILED: DecodeResultValue<-3>};
|
|
62
|
+
ChecksumResult: {SUCCESS: ChecksumResultValue<0>, MISMATCH: ChecksumResultValue<-1>};
|
|
57
63
|
Params: {
|
|
58
64
|
new(): Params;
|
|
59
65
|
};
|
|
60
|
-
init_params(_0: Params, _1: number, _2: EmbindString, _3: boolean):
|
|
66
|
+
init_params(_0: Params, _1: number, _2: EmbindString, _3: boolean): void;
|
|
67
|
+
verify_checksum(_0: any): void;
|
|
61
68
|
encode(_0: any, _1: Params): any;
|
|
62
69
|
decode(_0: any, _1: Params): any;
|
|
63
70
|
}
|
package/dist/l2encdec.node.js
CHANGED
|
Binary file
|