backup-deduplicator 0.3.0

A tool to deduplicate backups. It builds a hash tree of all files and folders in the target directory. Optionally also traversing into archives like zip or tar files. The hash tree is then used to find duplicate files and folders.
Documentation
use sha1::Digest;
use crate::hash::{GeneralHash, GeneralHasher};

pub struct Sha1Hasher {
    hasher: sha1::Sha1
}

impl GeneralHasher for Sha1Hasher {
    fn new() -> Self {
        Sha1Hasher {
            hasher: sha1::Sha1::new()
        }
    }

    fn update(&mut self, data: &[u8]) {
        self.hasher.update(data);
    }

    fn finalize(self: Box<Self>) -> GeneralHash {
        GeneralHash::SHA1(self.hasher.finalize().into())
    }
}