ethereumjs/keythereum

secure random number generation is not supported by this browser in react native

Closed this issue ยท 4 comments

I install lib, when build with debug chrome it work, but build on device or turn off debug then error:

secure random number generation is not supported by this browser
How to solution??

Unfortunately, I've never tested keythereum with react-native. Does crypto.randomBytes not work in that environment? If not, you could try swapping in secure-random and see if that has whatever polyfill is needed. (If this works for you, please feel free to submit a PR for it!)

Actually, it appears that secure-random isn't secure. Currently keythereum uses crypto-browserify, which uses crypto.randomBytes or window.crypto.getRandomBytes. @bachlongkocanh are neither of these available in your environment? (If not, how are random numbers normally generated in your environment?)

Use rn-nodeify resolve my error.

@bachlongkocanh I'm assuming that means that you've resolved this issue, so I'm closing this for now. Please reopen if I've misunderstood.