Valens-AIO/types/utils/HashUtil.d.ts

22 lines
700 B
TypeScript
Raw Normal View History

2022-07-30 00:35:54 -04:00
/// <reference types="node" />
import crypto from "crypto";
import { TimeUtil } from "./TimeUtil";
export declare class HashUtil {
protected timeUtil: TimeUtil;
constructor(timeUtil: TimeUtil);
2022-08-29 17:07:55 -04:00
/**
* Create a 24 character id using the sha256 algorithm + current timestamp
* @returns 24 character hash
*/
2022-07-30 00:35:54 -04:00
generate(): string;
generateMd5ForData(data: string): string;
generateSha1ForData(data: string): string;
2022-08-29 17:07:55 -04:00
/**
* Create a hash for the data parameter
* @param algorithm algorithm to use to hash
* @param data data to be hashed
* @returns hash value
*/
2022-07-30 00:35:54 -04:00
generateHashForData(algorithm: string, data: crypto.BinaryLike): string;
}