Skip to content

Commit

Permalink
Removes buffer-crc32
Browse files Browse the repository at this point in the history
Remove buffer-crc32 dependency and use crc32 from node:zlib
  • Loading branch information
refringe committed Jan 9, 2025
1 parent ab1b5cd commit 3967385
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
},
"dependencies": {
"atomically": "2.0.3",
"buffer-crc32": "~1.0",
"date-fns": "~3.6",
"date-fns-tz": "~3.1",
"fs-extra": "11.2.0",
Expand Down
4 changes: 2 additions & 2 deletions project/src/utils/HashUtil.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import crypto, { webcrypto } from "node:crypto";
import { crc32 } from "node:zlib";
import { TimeUtil } from "@spt/utils/TimeUtil";
import crc32 from "buffer-crc32";
import { mongoid } from "mongoid-js";
import { inject, injectable } from "tsyringe";
import { FileSystemSync } from "./FileSystemSync";
Expand Down Expand Up @@ -38,7 +38,7 @@ export class HashUtil {
}

public generateCRC32ForFile(filePath: string): number {
return crc32.unsigned(this.fileSystemSync.read(filePath));
return crc32(this.fileSystemSync.read(filePath));
}
/**
* Create a hash for the data parameter
Expand Down

0 comments on commit 3967385

Please sign in to comment.