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

Add require on safe-buffer dependency to fix Buffer undefined error when ran in a browser. #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frelibert
Copy link

This change makes browserify-rsa run in a browser, clientside, which is mainly the purpose of having a browserify module.
browserify-rsa depends on Buffer, which is part of Node js API, only available serverside and therefore not available when running in the browser.
This can be fixed by adding 'safe-buffer' as dependency and following require statement.

var Buffer = require('safe-buffer').Buffer

This was added to the index.js script, in the same way as allready set in browserify-aes and others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant