Why am I getting an "Uncaught DOM Exception" in the Deno CLI?
To replicate: 1.
deno
deno
in the command line to initialize a Deno REPL
// Get an array of random bytesconst arr = new Uint8Array(32)crypto.getRandomValues(arr)const decoder = new TextDecoder("utf8")btoa(decoder.decode(arr));> Uncaught DOMException
// Get an array of random bytesconst arr = new Uint8Array(32)crypto.getRandomValues(arr)const decoder = new TextDecoder("utf8")btoa(decoder.decode(arr));> Uncaught DOMException
The goal was to get a base64 encoding of the byte array. What am I doing wrong?