feat: v0.6.0

This commit is contained in:
2023-10-28 11:38:16 +08:00
parent 9ec0dba5b3
commit 373b3bcefc
9 changed files with 56 additions and 62 deletions

View File

@@ -33,6 +33,10 @@ impl DigestWrite {
}
}
pub fn sha256() -> XResult<Self> {
Ok(Self { digest: Box::new(Sha256::new()) })
}
pub fn digest(self) -> Vec<u8> {
let mut digest = self.digest;
let mut buf: Vec<u8> = repeat(0).take((digest.output_bits() + 7) / 8).collect();