Skip to content

Instantly share code, notes, and snippets.

@vshymanskyy
Created September 25, 2017 12:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vshymanskyy/6369e04f8dfb1ad7ac9e9f3f81e82075 to your computer and use it in GitHub Desktop.
Save vshymanskyy/6369e04f8dfb1ad7ac9e9f3f81e82075 to your computer and use it in GitHub Desktop.
TypedArray to base64 and back
input = new Float64Array([1,2,3,4])
encoded = Buffer.from(input.buffer).toString('base64')
buff = Buffer.from(encoded, 'base64');
decoded = new Float64Array(Uint8Array.from(buff).buffer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment