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

Function hash_file_contents

atomic-repository/src/status.rs:749–752  ·  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

747///
748/// The Blake3 hash of the file contents.
749pub fn hash_file_contents(path: &Path) -> StatusResult<Hash> {
750 let contents = std::fs::read(path)?;
751 Ok(Hash::of(&contents))
752}
753
754/// Collect all files in a directory, respecting ignore patterns.
755///

Callers 2

test_hash_file_contentsFunction · 0.85
statusMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_hash_file_contentsFunction · 0.68