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 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/) or [pnpm](https://pnpm.io/)
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
Binary file
@@ -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): 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
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-l2encdec",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "TypeScript/JavaScript bindings for open-l2encdec - Lineage 2 encryption library",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",