tiny_crypto/hash/
sha1.rs

1use ::sha1::Digest as _;
2
3/// The SHA1 hasher
4#[derive(Clone)]
5pub struct Sha1(::sha1::Sha1);
6
7impl super::Hasher for Sha1 {
8    fn new() -> Self {
9        Self(::sha1::Sha1::new())
10    }
11    fn update(&mut self, input: &[u8]) {
12        self.0.update(input);
13    }
14    fn finalize(self) -> Vec<u8> {
15        self.0.finalize().to_vec()
16    }
17}