//#region ../@warlock.js/fs/src/hash.d.ts type HashAlgorithm = "sha256" | "sha1" | "md5" | "sha512"; /** * Compute a hex digest of a file's contents. Uses streaming for large * files so memory doesn't spike when hashing big assets. * * @param path - File to hash. * @param algorithm - Hash algorithm (default `sha256`). * * @example * const fingerprint = await hashFile("./bundle.js"); * const quick = await hashFile("./small.txt", "md5"); */ declare function hashFileAsync(path: string, algorithm?: HashAlgorithm): Promise; declare function hashFile(path: string, algorithm?: HashAlgorithm): string; /** * Hash an in-memory string without touching disk. Convenient when the * caller already has the content loaded (e.g. file watcher diffing). */ declare function hashString(content: string, algorithm?: HashAlgorithm): string; /** * Hash an arbitrary buffer. */ declare function hashBuffer(content: Buffer | Uint8Array, algorithm?: HashAlgorithm): string; /** * Like `hashFileAsync` but reads the file in one go. Slightly faster for * small files; use the streaming variant for anything > ~1 MB. */ declare function hashFileSmallAsync(path: string, algorithm?: HashAlgorithm): Promise; //#endregion export { HashAlgorithm, hashBuffer, hashFile, hashFileAsync, hashFileSmallAsync, hashString }; //# sourceMappingURL=hash.d.mts.map