getrRandomValues error
vincenzoiovino opened this issue · 3 comments
vincenzoiovino commented
Hello,
I get the following error when trying to run the example you show:
decrypt(k1.toHex(), encrypt(k1.publicKey.toHex(), data)).toString()
/home/node_modules/@noble/ciphers/webcrypto/utils.js:18
throw new Error('crypto.getRandomValues must be defined');
^
Uncaught Error: crypto.getRandomValues must be defined
Any clue on how to bypass it?
kigawas commented
If you are on React Native, you may need to polyfill crypto.getRandomValues
.
Check https://github.com/paulmillr/noble-ciphers#usage for details
vincenzoiovino commented
No, I am not on react...
kigawas commented
In either case you need to polyfill