browserify-rsa
browserify-rsa copied to clipboard
Add require on safe-buffer dependency to fix Buffer undefined error when ran in a browser.
trafficstars
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.