4 releases (2 breaking)

Uses old Rust 2015

0.3.0 Sep 27, 2020
0.2.1 May 30, 2016
0.2.0 Mar 22, 2016
0.1.0 May 6, 2015
Download history 7/week @ 2021-08-07 7/week @ 2021-08-14 10/week @ 2021-08-21 1/week @ 2021-08-28 6/week @ 2021-09-11 3/week @ 2021-09-18 5/week @ 2021-10-02 8/week @ 2021-10-09 3/week @ 2021-10-16 5/week @ 2021-10-23 5/week @ 2021-10-30 5/week @ 2021-11-06 2/week @ 2021-11-13 5/week @ 2021-11-20

70 downloads per month
Used in hash-roll

BSD-3-Clause

18KB
533 lines

rollsum is based on bupsplit, which in turn is based on rsync chunking.

Interface liable to change.

https://docs.rs/rollsum

extern crate rollsum;

use std::env;
use std::fs;
use std::path::Path;
use std::io::prelude::*;

pub fn main () {
    let args: Vec<_> = env::args().collect();
    let mut file = fs::File::open(&Path::new(&args[1])).unwrap();
    let mut buf = vec![];
    file.read_to_end(&mut buf).unwrap();

    let mut ofs: usize = 0;
    while ofs < buf.len() {
        let mut b = rollsum::Bup::new();
        if let Some(count) = b.find_chunk_edge(&buf[ofs..]) {
            ofs += count;
            println!("found edge at {}", ofs);
        } else {
            println!("end of the line!");
            break
        }
    }
}

No runtime deps

p_