Skip to content

Instantly share code, notes, and snippets.

View neilrackett's full-sized avatar

Neil Rackett neilrackett

View GitHub Profile
@nuclearglow
nuclearglow / convert-arraybuffer.js
Created January 26, 2018 10:30
ArrayBuffer <-> JSON <-> ArrayBuffer
// array buffer to JSON
const dataString JSON.stringify(Array.from(new Uint8Array(arrayBuffer)));
// send around
// JSON to ArrayBuffer
new Uint8Array(JSON.parse(dataString)).buffer