Closed signorecello closed 1 year ago
crypto.randomBytes
is a nodejs function. If you are trying to use snrakjs in the browser, you need to use the IIFE browser build at https://github.com/iden3/snarkjs/blob/master/build/snarkjs.js (or set up your bundler correctly)
Running the example on the README with something like
snarkjs.zkey.contribute
fails on the browser withUncaught (in promise) TypeError: crypto.randomBytes is not a function
.I think
randomBytes
is not available anymore on browsers. An alternative could be found perhaps usingcypto.getRandomValues