Implement gpgui-helper

This commit is contained in:
Kevin Yue
2024-02-19 08:36:10 -05:00
parent 426989350e
commit c31c7c46d5
25 changed files with 557 additions and 222 deletions

View File

@@ -0,0 +1,14 @@
use std::path::Path;
use anyhow::bail;
pub fn verify_checksum(path: &str, expected: &str) -> anyhow::Result<()> {
let file = Path::new(&path);
let checksum = sha256::try_digest(&file)?;
if checksum != expected {
bail!("Checksum mismatch, expected: {}, actual: {}", expected, checksum);
}
Ok(())
}