(path: &Path)
| 382 | } |
| 383 | |
| 384 | fn content_hash(path: &Path) -> String { |
| 385 | let bytes = std::fs::read(path) |
| 386 | .unwrap_or_else(|e| panic!("Failed to read '{}': {}", path.display(), e)); |
| 387 | // Simple hash: use a basic FNV-1a 64-bit hash (no external deps) |
| 388 | let mut hash: u64 = 0xcbf29ce484222325; |
| 389 | for byte in &bytes { |
| 390 | hash ^= *byte as u64; |
| 391 | hash = hash.wrapping_mul(0x100000001b3); |
| 392 | } |
| 393 | format!("{:016x}", hash) |
| 394 | } |
| 395 | |
| 396 | fn handler_dep_globs_cached(hashes: &HashMap<String, String>, dep_key: &str) -> Vec<String> { |
| 397 | match hashes.get(dep_key) { |
no outgoing calls