<div class="gmail_quote">On Sun, Oct 10, 2010 at 5:06 PM, Masahiro Nakagawa <span dir="ltr"><<a href="mailto:repeatedly@gmail.com">repeatedly@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
What do you think?<br>
<br>
Masahiro<br></blockquote><div><br></div><div>So the only reason to re-write it was to change the license?</div><div><br></div><div>Some suggestions:</div><div><br></div><div>(API)</div><div><br></div><div>1. Convert the whole thing to a range based design.</div>
<div>ubyte[] <-> dchar range</div><div><br></div><div>2. Accept ubyte[] or void[] as well as string</div><div><br></div><div>3. Add a constant for no padding</div><div>maybe</div><div>enum NoPadding = '\0';</div>
<div><br></div><div>I think </div><div>alias Base64!('!', '=', Base64.NoPadding);</div><div>is a lot clearer and easier to use.</div><div><br></div><div>4. Rename Base64Impl to Base64 and add default arguments for the standard character/padding settings.</div>
<div><br></div><div>(Style)</div><div><br></div><div>5. Reduce use of *ptr++ style code in favour of foreach/ranges etc.</div><div><br></div><div>6. Use assumeUnique instead of casting arrays to immutable.</div><div><br></div>
<div>I think the entire thing should be @safe unless REALLY needed for speed.</div><div><br></div><div>Hope I've been helpful.</div><div>Daniel.<br><br></div></div>