Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,10 @@ mod tests {
#[test]
fn decode_tail_round_trip() {
for n in 1..=3usize {
let input: Vec<u8> = (0u8..=255)
.step_by(if n == 0 { 1 } else { 256 / n + 1 })
.take(n)
.collect();
// n ∈ {1, 2, 3}; step_by stride spreads `take(n)` samples across
// the byte range. `n == 0` would divide-by-zero, but it's
// excluded by the loop bounds.
let input: Vec<u8> = (0u8..=255).step_by(256 / n + 1).take(n).collect();
let encoded = base85::encode(&input);
let mut out = vec![0u8; n];
decode_tail(encoded.as_bytes(), &mut out, 0).expect("valid encoding");
Expand Down
Loading