Add gpgui-helper (#326)

This commit is contained in:
Kevin Yue
2024-02-21 07:34:14 -05:00
committed by GitHub
parent 5767c252b7
commit 4be877bf8c
53 changed files with 4351 additions and 51 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(())
}