Open Bug 687418 Opened 13 years ago Updated 2 years ago

base64 for typed arrays

Categories

(Core :: JavaScript Engine, defect)

x86_64
Windows 7
defect

Tracking

()

People

(Reporter: db48x, Unassigned)

Details

The browser provides btoa and atob for Base64 encoding/decoding of strings, but now that we can deal with binary data via typed arrays, we have to rewrite that in javascript regardless. I don't think it would be useful to extend these functions to take and return typed arrays directly (for how would you tell atob which type to return). Instead, perhaps we could add methods to ArrayBuffer? Either ArrayBuffer.btoa, or ArrayBuffer.encodeBase64 would work.
Seems like a JS-side kind of thing, no?
Assignee: nobody → general
Component: DOM → JavaScript Engine
QA Contact: general → general
DOM0, JS Enginge, it's all the same :)
Component: JavaScript Engine → DOM
ArrayBuffer and friends are the WebGL spec's ambit, right?  So you should propose .btoa or .encodeBase64 to them, maybe (although I very much doubt they want or need anything to do with atob/btoa).  Or maybe WhatWG should do it (but not on ArrayBuffer or some typed-array structure directly), since they're doing atob/btoa, should handle it.  The implementation might live in JS engine code in the end, but a prerequisite to it, for stuff exposed to the web, is its standardization in some appropriate place.

There's a component/QA mismatch now, but since I have no idea which component this really should live in, I'm just not going to bother touching it.  :-)
No, no, it's really not the same.  ;)
Component: DOM → JavaScript Engine
Oops, I didn't mean to change the component :)

Anyway, I bet we could ask dherman, see what he thinks.
Component: JavaScript Engine → DOM
!
Component: DOM → JavaScript Engine
Assignee: general → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.