wynn/ts/src/lib/util/hashers.ts

15 lines
350 B
TypeScript
Raw Normal View History

2025-02-27 03:56:30 +00:00
import crypto from "node:crypto";
import {IDataType, xxhash128} from "hash-wasm";
export function sha1Hash(data: crypto.BinaryLike) {
const hash = crypto.createHash('sha1');
hash.update(data);
return hash.digest('hex');
}
export async function fastHashFileV1(data: IDataType):Promise<string> {
const hash = xxhash128(data)
return hash
}