pub fn check(&self, src: &[u8]) -> anyhow::Result<()> {
        let sums = Sha256::digest(src);
        if sums.as_slice() != self.sums {
            anyhow::bail!(
                "artifact digest {} does not match provided digest {}",
                hex::encode(sums.as_slice()),
                hex::encode(self.sums.as_slice())
            );
        }
        Ok(())
    }
/// Check whether a file's digest matches the one provided.
Check whether a file's digest matches the one provided.
Check whether a file ' s digest matches the one provided .
pub fn check(&self, src: &[u8]) -> anyhow::Result<()> {
        let sums = Sha256::digest(src);
        if sums.as_slice() != self.sums {
            anyhow::bail!(
                "artifact digest {} does not match provided digest {}",
                hex::encode(sums.as_slice()),
                hex::encode(self.sums.as_slice())
            );
        }
        Ok(())
    }
pub fn check ( & self , src : & [ u8 ] ) -> anyhow :: Result < ( ) > { let sums = Sha256 :: digest ( src ) ; if sums . as_slice ( ) != self . sums { anyhow :: bail ! ( " " hex encode ( sums as_slice ( ) ) hex encode ( self sums as_slice ( ) ) ) ; } Ok ( ( ) ) }
Check whether a file's digest matches the one provided.
Check whether a file ' s digest matches the one provided .
&self
src
&[u8]
&self
src
&[u8]