diff --git a/nodejs/src/monte.ts b/nodejs/src/monte.ts index d1ea578..2bb30b1 100644 --- a/nodejs/src/monte.ts +++ b/nodejs/src/monte.ts @@ -27,8 +27,8 @@ export class MonteSocket extends Duplex { #pending: EventEmitter = new EventEmitter(); #counter: number = 0; - #readNonce: bigint = 0n; - #writeNonce: bigint = 0n; + #readNonce: bigint = BigInt(0); + #writeNonce: bigint = BigInt(0); #sock: net.Socket; #secret: Uint8Array; @@ -122,7 +122,7 @@ export class MonteSocket extends Duplex { public encrypt(buf: Buffer): Buffer { const nonce = Buffer.alloc(12); nonce.writeBigUInt64BE(this.#writeNonce); - this.#writeNonce += 1n; + this.#writeNonce++; const cipher = crypto.createCipheriv("aes-256-gcm", this.#secret, nonce, { authTagLength: 16, @@ -138,7 +138,7 @@ export class MonteSocket extends Duplex { const nonce = Buffer.alloc(12); nonce.writeBigUInt64BE(this.#readNonce); - this.#readNonce += 1n; + this.#readNonce++; const decipher = crypto.createDecipheriv( "aes-256-gcm", diff --git a/nodejs/tsconfig.json b/nodejs/tsconfig.json index 290c877..55fa89d 100644 --- a/nodejs/tsconfig.json +++ b/nodejs/tsconfig.json @@ -5,7 +5,7 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "es2020", + "target": "es2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */