Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support react-native #50

Merged
merged 2 commits into from Jan 15, 2020
Merged

Support react-native #50

merged 2 commits into from Jan 15, 2020

Conversation

@pedrouid
Copy link

pedrouid commented Jan 3, 2020

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.

@pedrouid

This comment has been minimized.

Copy link
Author

pedrouid commented Jan 15, 2020

browser.js Outdated Show resolved Hide resolved
@JBaczuk

This comment has been minimized.

Copy link
Collaborator

JBaczuk commented Jan 15, 2020

@pedrouid Hey sorry for the delay on this! I assume you've tested that this works, see my comment above.

@pedrouid

This comment has been minimized.

Copy link
Author

pedrouid commented Jan 15, 2020

Hey @JBaczuk, yes I have tested it with a postinstall script to make that code change. I have updated the PR with your comment

@JBaczuk

This comment has been minimized.

Copy link
Collaborator

JBaczuk commented Jan 15, 2020

Thanks, I'll merge now.

@JBaczuk JBaczuk changed the base branch from master to 1.1 Jan 15, 2020
@JBaczuk JBaczuk merged commit 8ce6f38 into bitchan:1.1 Jan 15, 2020
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@pedrouid pedrouid deleted the pedrouid:patch-1 branch Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.