/** * SHA256 hashing utilities for file content verification * * Used by Scampi's codebase caching feature to detect file changes. * When checking if files changed, we compare mtime first (fast), * then hash if needed for verification. */ /** * Compute SHA256 hash of a file using streaming for memory efficiency * * Uses Node.js streams to handle large files without loading * the entire file into memory. * * @param filePath - Absolute path to the file to hash * @returns Promise resolving to the hex-encoded SHA256 hash * @throws Error if the file cannot be read (e.g., not found, permission denied) * * @example * ```typescript * const hash = await hashFile('/path/to/file.ts'); * console.log(hash); // '2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824' * ``` */ export declare function hashFile(filePath: string): Promise; /** * Compute SHA256 hash of a string * * Convenience function for testing and hashing in-memory content. * For file content, prefer hashFile() for memory efficiency. * * @param content - The string content to hash * @returns The hex-encoded SHA256 hash * * @example * ```typescript * const hash = hashString('hello'); * console.log(hash); // '2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824' * ``` */ export declare function hashString(content: string): string; /** * Compute SHA256 hash of a Buffer * * Convenience function for hashing binary data in memory. * * @param data - The buffer to hash * @returns The hex-encoded SHA256 hash * * @example * ```typescript * const hash = hashBuffer(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f])); * console.log(hash); // '2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824' * ``` */ export declare function hashBuffer(data: Buffer): string; //# sourceMappingURL=hash.d.ts.map