~joshleeb/fastcdc

3df1ad07e666d1c43c94827b552d1048c545ef45 — Josh Leeb-du Toit 4 months ago 33a7b88 master
Minor updates to docs
3 files changed, 5 insertions(+), 4 deletions(-)

M README.md
M src/chunk.rs
M src/lib.rs
M README.md => README.md +2 -1
@@ 2,7 2,8 @@

An implementation of the FastCDC algorithm for content-defined chunking.

FastCDC builds on the [Gear hashing][gear] function by applying techniques of
FastCDC builds on the [Gear-based CDC][gear] function with the following
improvements.

1. simplified and enhanced hash judgement;
2. sub-minimum chunk cut-point skipping; and

M src/chunk.rs => src/chunk.rs +1 -1
@@ 48,7 48,7 @@ impl Opts {
    ///
    /// # Panics
    ///
    /// If the `min_len` >= `desired_len`.
    /// If the minimum chunk length >= desired chunk length.
    pub fn with_min_len(self, min_len: usize) -> Self {
        assert!(min_len < self.desired_len);
        Self { min_len, ..self }

M src/lib.rs => src/lib.rs +2 -2
@@ 8,7 8,7 @@ pub mod chunk;
mod mask;
mod table;

/// Gear hasher.
/// FastCDC enhanced Gear hasher.
#[derive(Clone)]
pub struct Hasher<'t> {
    table: &'t Table,


@@ 48,7 48,7 @@ impl<'t> Hasher<'t> {
    }

    /// Returns true if the current digest is a chunk boundary with the `mask`, and false
    /// otherwise.  To generate a mask value, see [`mask`].
    /// otherwise.
    pub fn is_chunk_boundary(&self, mask: u64) -> bool {
        self.hash & mask == 0
    }