wynn/ts/src/lib/util/hashers.ts
a 53f46934e8
Some checks failed
commit-tag / commit-tag-image (map[context:./migrations file:./migrations/Dockerfile name:migrations]) (push) Successful in 21s
commit-tag / commit-tag-image (map[context:./ts file:./ts/Dockerfile name:ts]) (push) Has been cancelled
noot
2025-06-14 18:04:46 -05:00

14 lines
352 B
TypeScript

import crypto from 'node:crypto'
import { type 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
}