| Crates.io | cdc-chunkers |
| lib.rs | cdc-chunkers |
| version | 0.1.3 |
| created_at | 2025-02-02 19:00:13.893826+00 |
| updated_at | 2025-02-18 11:52:00.305464+00 |
| description | A collection of Content Defined Chunking algorithms |
| homepage | |
| repository | https://github.com/Piletskii-Oleg/rust-chunking |
| max_upload_size | |
| id | 1539805 |
| size | 68,170 |
Content Based Chunking algorithms implementation:
Simple code to test an algorithm is provided in filetest.rs.
std::iter::Iterator trait, giving out data about the source dataset
in the form of chunks.To use them in custom code, the algorithms can be accessed using the corresponding modules, e.g.
fn main() {
let data = vec![1; 1024 * 1024];
let sizes = SizeParams::new(4096, 8192, 16384);
let chunker = ultra::Chunker::new(&data, sizes);
for chunk in chunker {
println!("start: {}, length: {}", chunk.pos, chunk.len);
}
let default_leap = leap_based::Chunker::new(&data, SizeParams::leap_default());
for chunk in default_leap {
println!("start: {}, length: {}", chunk.pos, chunk.len);
}
}