Expand description
§SeqChunking
A Rust library for sequence-based data chunking using slope detection algorithms.
This library provides efficient algorithms for dividing data streams into chunks based on byte sequence patterns (increasing or decreasing slopes). It’s particularly useful for content-defined chunking applications.
§Quick Start
use seq_chunking::{SeqChunking, ChunkingConfig};
// Create a chunker with default settings
let chunker = SeqChunking::new();
// Or with custom configuration
let config = ChunkingConfig::builder()
.seq_threshold(10)
.min_block_size(2048)
.build().expect("Failed to build ChunkingConfig");
let chunker = SeqChunking::from_config(config);
// Chunk some data
let data = b"your data here";
let chunks: Vec<_> = chunker.chunk_all(data).collect();
Re-exports§
pub use config::ChunkingConfig;
pub use config::SeqOpMode;
pub use chunker::SeqChunking;
pub use chunker::Chunk;
pub use chunker::ChunkIterator;
pub use error::ChunkingError;
pub use error::Result;
Modules§
- chunker
- Core chunking implementation.
- config
- Configuration module for sequence-based chunking.
- error
- Error handling for the chunking library.
- utils
- Utility functions for the chunking library.
Constants§
- DEFAULT_
AVG_ BLOCK_ SIZE - Default average block size
- DEFAULT_
JUMP_ SIZE - Default jump size when trigger is hit
- DEFAULT_
JUMP_ TRIGGER - Default jump trigger count
- DEFAULT_
MAX_ BLOCK_ SIZE - Default maximum block size
- DEFAULT_
MIN_ BLOCK_ SIZE - Default minimum block size
- DEFAULT_
SEQ_ THRESHOLD - Default sequence length threshold