W3C home > Mailing lists > Public > public-webcrypto@w3.org > September 2012

RE: JS code examples for ACTION 43

From: Vijay Bharadwaj <Vijay.Bharadwaj@microsoft.com>
Date: Fri, 7 Sep 2012 06:48:29 +0000
To: Arun Ranganathan <arun@mozilla.com>, Wan-Teh Chang <wtc@google.com>
CC: Ryan Sleevi <sleevi@google.com>, David Dahl <ddahl@mozilla.com>, "public-webcrypto@w3.org Working Group" <public-webcrypto@w3.org>
Message-ID: <382AD43736BB12439240773F68E90773AFCE11@DF-M14-21.exchange.corp.microsoft.com>
> 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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 7 September 2012 06:51:34 GMT