ebpfsieve 0.1.0

Byte-frequency prefilter for read-heavy scanning pipelines with optional eBPF offload
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use ebpfsieve::{ByteFrequencyFilter, ByteThreshold};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let t = ByteThreshold::new(b'A', 1);
    let filter = ByteFrequencyFilter::new([t])?.with_window_size(2)?;
    let input = b"AAAA";

    let mut iter = filter.matching_windows_iter(input);
    println!("{:?}", iter.next()); // Should return offset 0
    println!("{:?}", iter.next()); // Panics!
    Ok(())
}