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

Re: [whatwg] BinaryEncoding for Typed Arrays using window.btoa and window.atob

From: Kenneth Russell <kbr@google.com>
Date: Mon, 5 Aug 2013 17:41:56 -0700
Message-ID: <CAMYvS2eHvHps9djCME2iS1R5mpfegd3KCy8STWmp+s-m3cjOKg@mail.gmail.com>
To: Simon Pieters <simonp@opera.com>
Cc: WHAT Working Group <whatwg@lists.whatwg.org>, Chang Shu <cshu01@gmail.com>
On Mon, Aug 5, 2013 at 2:04 PM, Simon Pieters <simonp@opera.com> wrote:
> On Mon, 05 Aug 2013 22:39:22 +0200, Chang Shu <cshu01@gmail.com> wrote:
>
>> I see your point now, Simon. Technically both approaches should work.
>> As you said, yours has the limitation that the implementation does not
>> know which view to return unless you provide an enum type of parameter
>> instead of boolean to atob. And mine has the performance issue. How
>> about we don't return the 'binary' string in case the 2nd parameter is
>> provided in my case?
>
>
> That works for me.

Chang, in your proposal for modifying atob, how does the developer
know how many characters were written into the outgoing
ArrayBufferView?

What happens if the ArrayBufferView argument isn't large enough to
hold the decoded string?

During the decoding process, is the type of the ArrayBufferView
significant? In your example, what would happen if an Int16Array were
passed instead of an Int32Array?

The Encoding spec at http://encoding.spec.whatwg.org/ seems to have
handled issues like these. Perhaps a better route would be to fold
this functionality into that spec.

-Ken
Received on Tuesday, 6 August 2013 00:42:20 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:23 UTC