Skip to content

Commit ce74f85

Browse files
committed
chore: replace object-hash with node-object-hash library
1 parent 02fe636 commit ce74f85

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

package-lock.json

Lines changed: 11 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"morgan": "^1.10.0",
4242
"nest-winston": "^1.9.7",
4343
"nestjs-zod": "3.0.0",
44-
"object-hash": "^3.0.0",
44+
"node-object-hash": "^3.1.1",
4545
"passport": "0.7.0",
4646
"passport-jwt": "4.0.1",
4747
"pretty-bytes": "^5.6.0",

src/modules/xray-core/xray.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { InjectXtls } from '@remnawave/xtls-sdk-nestjs';
33
import { ConfigService } from '@nestjs/config';
44
import { XtlsApi } from '@remnawave/xtls-sdk';
55
import { execa } from '@cjs-exporter/execa';
6-
import objectHash from 'object-hash';
6+
import { hasher } from 'node-object-hash';
77
import { table } from 'table';
88
import ems from 'enhanced-ms';
99
import semver from 'semver';
@@ -309,7 +309,11 @@ export class XrayService implements OnApplicationBootstrap, OnModuleInit {
309309
}
310310

311311
private getConfigChecksum(config: Record<string, unknown>): string {
312-
return objectHash(config, { unorderedArrays: true, algorithm: 'sha256' });
312+
const hash = hasher({
313+
trim: true,
314+
}).hash;
315+
316+
return hash(config);
313317
}
314318

315319
private async getXrayVersionFromExec(): Promise<null | string> {

0 commit comments

Comments
 (0)