RE: JS code examples for ACTION 43

> What I meant here is that in order to use the right kind of view, we need to know *what kind* of data we're working with.

Isn't that par for the course when implementing a crypto protocol? Cryptographic algorithms tend to work on bit strings, so figuring out the source data encoding is always a big deal.

-----Original Message-----
From: Arun Ranganathan [mailto:arun@mozilla.com] 
Sent: Thursday, September 6, 2012 10:29 AM
To: Wan-Teh Chang
Cc: Ryan Sleevi; David Dahl; public-webcrypto@w3.org Working Group
Subject: Re: JS code examples for ACTION 43


On Sep 6, 2012, at 1:12 PM, Wan-Teh Chang wrote:

> On Thu, Sep 6, 2012 at 7:38 AM, Arun Ranganathan <arun@mozilla.com> wrote:
>> 
>> 1. The general unwieldiness of ArrayBufferViews.  I shouldn't have 
>> used a Uint16Array, so no cookie for me.  But this raises an 
>> interesting point: should we just use an ArrayBuffer, or should we 
>> use an ArrayBufferView?  Using an ArrayBufferView obliges users to go through one additional step: figuring out what the data format *is*.  UTF-16?
>> UTF-8?
> 
> Did you mean UTF-16 & UTF-8, or Uint16 and Uint8? I don't see "UTF"
> mentioned on this Mozilla page:
> https://developer.mozilla.org/en-US/docs/JavaScript_typed_arrays/Array
> BufferView#Typed_array_subclasses
> 

What I meant here is that in order to use the right kind of view, we need to know *what kind* of data we're working with. 

For instance, is it string data encoded as UTF-16?  Or something else?  If working only with ASCII, we might be able to simply use a different ArrayBufferView (or modify our utility).

-- A*


> Wan-Teh
> 

Received on Friday, 7 September 2012 06:51:33 UTC