diff --git a/project/package.json b/project/package.json index 83d89640..a9379324 100644 --- a/project/package.json +++ b/project/package.json @@ -41,6 +41,7 @@ "json-fixer": "~1.6", "json5": "~2.2", "jsonc": "~2.0", + "mongoid-js": "~1.3", "proper-lockfile": "~4.1", "reflect-metadata": "~0.2", "semver": "~7.6", diff --git a/project/src/utils/HashUtil.ts b/project/src/utils/HashUtil.ts index 546f3a51..70ef6b08 100644 --- a/project/src/utils/HashUtil.ts +++ b/project/src/utils/HashUtil.ts @@ -1,6 +1,7 @@ import crypto from "node:crypto"; import fs from "node:fs"; import crc32 from "buffer-crc32"; +import { mongoid } from "mongoid-js"; import { inject, injectable } from "tsyringe"; import { TimeUtil } from "@spt/utils/TimeUtil"; @@ -16,11 +17,7 @@ export class HashUtil */ public generate(): string { - const shasum = crypto.createHash("sha256"); - const time = Math.random() * this.timeUtil.getTimestamp(); - - shasum.update(time.toString()); - return shasum.digest("hex").substring(0, 24); + return mongoid(); } public generateMd5ForData(data: string): string