Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Support react-native #50
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.