* Listens for messages from a calling function.\r
*/\r
addEventListener('message', (message) => {\r
- console.log(`nacl work received (${performance.now()})`)\r
const data = JSON.parse(new TextDecoder().decode(message.data ?? message))\r
// for (const d of data) {\r
for (let i = 0; i < data.length; i++) {\r
data[i].publicKey = hexify(keyPair(data[i].privateKey).publicKey)\r
}\r
const buf = new TextEncoder().encode(JSON.stringify(data)).buffer\r
- //@ts-expect-error\r
- console.log(`nacl work done (${performance.now()})`)\r
postMessage(buf, [buf])\r
})\r
\r