26 lines
861 B
TypeScript
Raw Normal View History

2023-06-11 15:10:34 +10:00
/// <reference types="node" />
2024-04-03 20:15:11 +11:00
/// <reference types="node" />
import crypto from "node:crypto";
import fs from "node:fs";
2024-08-05 20:33:00 +10:00
import { TimeUtil } from "@spt/utils/TimeUtil";
2023-06-11 15:10:34 +10:00
export declare class HashUtil {
protected timeUtil: TimeUtil;
constructor(timeUtil: TimeUtil);
/**
* Create a 24 character id using the sha256 algorithm + current timestamp
* @returns 24 character hash
*/
generate(): string;
generateMd5ForData(data: string): string;
generateSha1ForData(data: string): string;
2024-04-03 20:15:11 +11:00
generateCRC32ForFile(filePath: fs.PathLike): number;
2023-06-11 15:10:34 +10:00
/**
* Create a hash for the data parameter
* @param algorithm algorithm to use to hash
* @param data data to be hashed
* @returns hash value
*/
generateHashForData(algorithm: string, data: crypto.BinaryLike): string;
2023-10-09 20:21:00 +11:00
generateAccountId(): number;
2023-06-11 15:10:34 +10:00
}