From feaedd8194f4a7aad2c36642e41f46c7e9d515e0 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 25 Mar 2018 13:18:30 -0400 Subject: [PATCH] 1.1: Comment updates --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 096a2e8..9c3985c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,11 +31,11 @@ pub fn base64(hex: &str) -> Result { } if acc != 0 { + // Pad the string if we have bits remaining. acc = acc << (24 - num_bits); let padding = (24 - num_bits) / 6; for i in (0..4).rev() { let out_char_idx = ((acc >> (6 * i)) & 0x3F) as usize; - // TODO: I don't like this nth() call. if i < padding { out.push('='); } else if let Some(out_char) = B64.chars().nth(out_char_idx) {