-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Labels
featnew feature (which has been agreed to/accepted)new feature (which has been agreed to/accepted)upstreamChanges in upstream are required to solve these issuesChanges in upstream are required to solve these issues
Description
The tc39 Uint8Array to/from base64 and hex proposal is stage 3.
Support for this would significantly reduce boilerplate code.
Examples:
let arr = new Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]);
console.log(arr.toBase64());
// 'SGVsbG8gV29ybGQ='
console.log(arr.toHex());
// '48656c6c6f20576f726c64'
let string = 'SGVsbG8gV29ybGQ=';
console.log(Uint8Array.fromBase64(string));
// Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100])
string = '48656c6c6f20576f726c64';
console.log(Uint8Array.fromHex(string));
// Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100])
wanderer, brc-dd, iuioiua, fcrozatier, yuhr and 3 more
Metadata
Metadata
Assignees
Labels
featnew feature (which has been agreed to/accepted)new feature (which has been agreed to/accepted)upstreamChanges in upstream are required to solve these issuesChanges in upstream are required to solve these issues