Skip to content

Commit 96b29d8

Browse files
Improve comments and increase test paranoia.
1 parent 2b5112f commit 96b29d8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/chunked_encoder.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ impl<'e, E: Engine + ?Sized> ChunkedEncoder<'e, E> {
3434
let mut len = self.engine.internal_encode(chunk, &mut buf);
3535
if chunk.len() != CHUNK_SIZE && self.engine.config().encode_padding() {
3636
// Final, potentially partial, chunk.
37+
// Only need to consider if padding is needed on a partial chunk since full chunk
38+
// is a multiple of 3, which therefore won't be padded.
3739
// Pad output to multiple of four bytes if required by config.
3840
len += add_padding(len, &mut buf[len..]);
3941
}
@@ -121,7 +123,7 @@ pub mod tests {
121123
let mut rng = rand::rngs::SmallRng::from_entropy();
122124
let input_len_range = Uniform::new(1, 10_000);
123125

124-
for _ in 0..5_000 {
126+
for _ in 0..20_000 {
125127
input_buf.clear();
126128
output_buf.clear();
127129

0 commit comments

Comments
 (0)