MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / hash_file_contents

Function hash_file_contents

atomic-repository/src/status.rs:761–764  ·  view source on GitHub ↗

Hash the contents of a file using Blake3. This is used to compute content hashes for modification detection. # Arguments `path` - Path to the file to hash # Returns The Blake3 hash of the file contents.

(path: &Path)

Source from the content-addressed store, hash-verified

759///
760/// The Blake3 hash of the file contents.
761pub fn hash_file_contents(path: &Path) -> StatusResult<Hash> {
762 let contents = std::fs::read(path)?;
763 Ok(Hash::of(&contents))
764}
765
766/// Collect all files in a directory, respecting ignore patterns.
767///

Callers 2

test_hash_file_contentsFunction · 0.85
status_innerMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_hash_file_contentsFunction · 0.68