/** * Hashing utilities for cache invalidation and file tracking */ /** * Generate a hash for file content */ export declare function hashContent(content: string | Buffer): string; /** * Generate a hash for a file */ export declare function hashFile(filePath: string): string; /** * Generate a hash that includes file metadata (size, mtime) */ export declare function hashFileWithMetadata(filePath: string): string; /** * Generate a lightweight hash based on file metadata only (fast) */ export declare function hashFileMetadata(filePath: string): string; /** * Generate a cache key from namespace and parameters */ /** * The cache key for "the last content written to this path". * * ONE KEY BOTH SIDES AGREE ON, keyed on the path ALONE. The read key * (`generateCacheKey('smart-read', { path, options })`) also hashes the read * options, so an entry seeded under one set of options is invisible to a read * that uses another -- which makes it useless as a handoff between a writer and * a reader that never agreed on options. The write key * (`generateCacheKey('file-write', { path })`) is a different namespace again, * so a writer populating it taught the reader nothing. * * Anything written through this key must go through `cacheSet`, not * `cache.set`: readers use `cacheGet`, which expects base64 gzip and treats a * decode failure as a miss, so raw text stored here would read back as nothing. */ export declare function lastWrittenKey(path: string): string; export declare function generateCacheKey(namespace: string, params: Record): string; /** * Check if two hashes match */ export declare function hashesMatch(hash1: string, hash2: string): boolean; /** * Generate a short hash (first 8 characters) for display purposes */ export declare function shortHash(content: string | Buffer): string; //# sourceMappingURL=hash-utils.d.ts.map