W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2013

Re: [whatwg] Adding a btoa overload that takes Uint8Array

From: Mark Watson <watsonm@netflix.com>
Date: Wed, 6 Mar 2013 16:07:07 +0000
To: Kenneth Russell <kbr@google.com>
Message-ID: <5644AC8B-3BDD-4945-A951-2C1A5B0C1040@netflix.com>
Cc: whatwg <whatwg@whatwg.org>, Boris Zbarsky <bzbarsky@mit.edu>, Joshua Bell <jsbell@chromium.org>
Whilst on the topic of base64, has anyone considered adding support for base64url ?

ůMark

On Mar 4, 2013, at 10:29 AM, Kenneth Russell wrote:

> On Mon, Mar 4, 2013 at 10:04 AM, Joshua Bell <jsbell@chromium.org> wrote:
>> On Mon, Mar 4, 2013 at 9:09 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>> 
>>> The problem I'm trying to solve is sending Unicode text to consumers who
>>> need base64-encoded input.  Right now the only "sane" way to do it (and I
>>> quote "sane" for obvious reasons) is something like the example at
>>> https://developer.mozilla.org/**en-US/docs/DOM/window.btoa#**
>>> Unicode_Strings<https://developer.mozilla.org/en-US/docs/DOM/window.btoa#Unicode_Strings>
>>> 
>>> It seems like it would be better if the output of a TextEncoder could be
>>> passed directly to btoa.  But for that we need an overload of btoa that
>>> takes a Uint8Array.
>>> 
>> 
>> FYI, I believe the last iteration on this topic ended with this message:
>> 
>> http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-June/036372.html
>> 
>> i.e. consensus that base64 should stay out of the Encoding API, but that it
>> would be nice to have some form of base64 / Typed Array conversion API. But
>> there were no concrete proposals beyond my strawman in that post.
>> 
>> So: agreed, have at it!
> 
> Yes, adding an overload of btoa taking Uint8Array sounds good.
> 
Received on Wednesday, 6 March 2013 16:07:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 6 March 2013 16:07:33 GMT