[phobos] std.base64 replacement

Masahiro Nakagawa repeatedly at gmail.com
Fri Oct 29 01:27:25 PDT 2010


On Wed, 27 Oct 2010 17:10:16 +0900, Daniel Murphy <yebblies at gmail.com>  
wrote:

> On Wed, Oct 27, 2010 at 2:20 AM, Masahiro Nakagawa  
> <repeatedly at gmail.com>wrote:
>
>> Applied!
>>
>
>  Great!
>
> The only thing that still bugs me a little is the error messages:
> "Cannot call popFront on empty range" should probably say something like
> "Cannot call popFront on Encoder with no data remaining", but it's really
> superficial.
> The static asserts could also be improved (I know I did them in the first
> place)
>
> static assert(Map62th < 'A' || Map62th > 'Z', "Character '" ~ Map62th ~  
> "'
> cannot be used twice");
> static assert(Map62th != NoPadding, "'\\0' is not a valid base64
> character");

You are right. Thanks!

http://bitbucket.org/repeatedly/scrap/changeset/70f0d0f16ad1

> Decoder currently advances partially on each call to front!  This code
> should be moved into popFront, or at the very least the result should be
> cached.
> Encoder doesn't advance, but currently re-encodes the data on each call  
> to
> front.  This should also be moved into popFront.

Your suggestion increases struct size and decreases performance.
But, I agree.

http://bitbucket.org/repeatedly/scrap/changeset/75ee04cdd87b


Masahiro


More information about the phobos mailing list