[phobos] std.base64 replacement
Masahiro Nakagawa
repeatedly at gmail.com
Mon Oct 11 18:48:33 PDT 2010
I added following features.
- encode and decode functions take buffer or OutputRange
- Helper functions for calculating buffer size
-- encodeLength and decodeLength names from std.base64 API.
- Encoder and Decoder for Range interface
Please check the code.
http://bitbucket.org/repeatedly/scrap/src/tip/base64.d
Masahiro
On Mon, 11 Oct 2010 13:02:59 +0900, Andrei Alexandrescu
<andrei at erdani.com> wrote:
> If you define encoding and decoding on a range, there's no need to
> allocate for every pass through the loop. You reuse the buffer.
>
> @Sean: I doubt you'll see any performance improvement if you encode
> in-place vs. in a separate buffer.
>
>
> Andrei
>
> On 10/10/10 22:25 CDT, Masahiro Nakagawa wrote:
>> I agree. Last night, I thought about encode / decode with buffer.
>> In range, each memory allocation on loop is bad...
>>
>>
>> Masahiro
>>
>> On Mon, 11 Oct 2010 11:45:08 +0900, Sean Kelly <sean at invisibleduck.org>
>> wrote:
>>
>>> As others have said, I'd like this to use ranges instead if possible,
>>> and I'd like the option to supply a destination range as well. The
>>> majority of work I do with this sort of thing encodes in-place into
>>> existing buffers.
>>>
>>> _______________________________________________
>>> phobos mailing list
>>> phobos at puremagic.com
>>> http://lists.puremagic.com/mailman/listinfo/phobos
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
More information about the phobos
mailing list