MCPcopy Create free account
hub / github.com/CodeBendKit/codeseek / compute_file_md5

Method compute_file_md5

rust-core/src/storage/incremental.rs:39–43  ·  view source on GitHub ↗

计算文件的MD5哈希值

(&self, file_path: &Path)

Source from the content-addressed store, hash-verified

37
38 /// 计算文件的MD5哈希值
39 pub fn compute_file_md5(&self, file_path: &Path) -> Result<String, io::Error> {
40 let content = fs::read(file_path)?;
41 let hash = md5::compute(&content);
42 Ok(format!("{:x}", hash))
43 }
44
45 /// 检查文件是否需要更新
46 pub fn needs_update(&self, file_path: &Path) -> Result<bool, io::Error> {

Callers 2

needs_updateMethod · 0.80
refresh_fileMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected