jedisct1 / libsodium.js

libsodium compiled to Webassembly and pure JavaScript, with convenient wrappers.
Other
968 stars 138 forks source link

not work in node js #291

Closed iocmet closed 1 year ago

iocmet commented 2 years ago

const sodium = require('libsodium-wrappers') sodium.crypto_secretbox_easy(opuspacket, b, skey)

TypeError: sodium.crypto_secretbox_easy is not a function

iocmet commented 2 years ago

fixed now

UnhandledPromiseRejectionWarning: TypeError: unsupported input type for key

jedisct1 commented 2 years ago

The error looks self explanatory 😀

Your application supplied an incorrect nonce size.

iocmet commented 2 years ago

what a nonce

iocmet commented 2 years ago

i am trying to encode opus packets via libsodium and i get the secret key from discord voice gateway

iocmet commented 2 years ago

but now i get this error: unsupported input type for key