Using some example code here:
https://docs.rs/hash-roll/0.3.0/hash_roll/trait.Chunk.html#tymethod.find_chunk_edge
It turns out that discard_ct could result in data.len() + 1 in size as seen in this code:
https://docs.rs/hash-roll/0.3.0/src/hash_roll/fastcdc.rs.html#75
The only happens when the boundary is on the last byte and can result in i equaling data.len() causing &data[..data.len() + 1] resulting in a panic.
The fix is simple, I might suggest adding something like this to the docs:
if discard_ct > data_buf.len() {
break;
}
Thanks for the hard work in providing this library!