Closed pedrouid closed 4 years ago
cc @JBaczuk @Kagami
@pedrouid Hey sorry for the delay on this! I assume you've tested that this works, see my comment above.
Hey @JBaczuk, yes I have tested it with a postinstall script to make that code change. I have updated the PR with your comment
Thanks, I'll merge now.
This library can work in a react-native environment that uses rn-nodeify to support NodeJS crypto modules (which is very common in most projects)
The only change necessary is to check if browserCrypto or browserCrypto.getRandomValues is undefined on the randomBytes instead of checking if window is undefined. The reason for this is that window may be polyfill'd for other reasons but WebCrypto is usually not.