Compute SHA-256 content hash of file content.
(content: &str)
| 94 | |
| 95 | /// Compute SHA-256 content hash of file content. |
| 96 | pub fn content_hash(content: &str) -> String { |
| 97 | let mut hasher = Sha256::new(); |
| 98 | hasher.update(content.as_bytes()); |
| 99 | let result = hasher.finalize(); |
| 100 | hex::encode(result) |
| 101 | } |
| 102 | |
| 103 | /// Find files whose stored content hash differs from the current hash. |
| 104 | pub async fn find_stale_files( |
no outgoing calls