Skip to content

Commit

Permalink
Improve comments and increase test paranoia.
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallpierce committed Aug 26, 2023
1 parent 2b5112f commit 96b29d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/chunked_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ impl<'e, E: Engine + ?Sized> ChunkedEncoder<'e, E> {
let mut len = self.engine.internal_encode(chunk, &mut buf);
if chunk.len() != CHUNK_SIZE && self.engine.config().encode_padding() {
// Final, potentially partial, chunk.
// Only need to consider if padding is needed on a partial chunk since full chunk
// is a multiple of 3, which therefore won't be padded.
// Pad output to multiple of four bytes if required by config.
len += add_padding(len, &mut buf[len..]);
}
Expand Down Expand Up @@ -121,7 +123,7 @@ pub mod tests {
let mut rng = rand::rngs::SmallRng::from_entropy();
let input_len_range = Uniform::new(1, 10_000);

for _ in 0..5_000 {
for _ in 0..20_000 {
input_buf.clear();
output_buf.clear();

Expand Down

0 comments on commit 96b29d8

Please sign in to comment.