From: Gavin Sinclair Date: 2004-02-12T21:09:29+09:00 Subject: Comments on base64.rb While adding documentation to base64.rb and backporting it to 1.8, I noticed that I found the module hard to understand. Now, I'm not that familiar with base64 in general, but here are my comments: * why must b64encode _print_ a string; why not just return it? * having encode64 and b64encode is confusing; they do practcally the same thing, and their names don't help distinguish them * why not let encode64 take a line length * b64encode didn't even appear to work; I'll check for unit tests (I didn't see any variation of length of lines with different values) In short, if I were creating a Base64 module, it would look like this. module Base64 def encode64(data, len=nil); ... def decode64(str); ... def decode_b(str); ... # What about encode_b? Shows how much I know. end This probably isn't considered important, but anyway. The above module could become a reality: * deprecate b64encode, unless it's actually necessary * add optional argument to encode64; it wouldn't change current interface Gavin