Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Fix for browserify #47

Merged
merged 2 commits into from
Dec 3, 2016
Merged

Fix for browserify #47

merged 2 commits into from
Dec 3, 2016

Conversation

nikuda
Copy link
Contributor

@nikuda nikuda commented Dec 3, 2016

util.toBase64 would throw an error as bn.toBuffer doesn't work with browserify. bn.toArrayLike is used instead.

bn.toBuffer is a simple wrapper for bn.toArrayLike anyway so there are no downsides here between node/browser.

https://github.com/indutny/bn.js/blob/master/lib/bn.js#L516

Fixes: #41

bn.toArrayLike is used instead of bn.toBuffer
It will not trigger the bn.toBuffer browserify bug
as browserify bundles are not tested in the browser
but it could still be useful.
@dignifiedquire
Copy link
Member

Sweet thank you :octocat:

@dignifiedquire dignifiedquire merged commit 9331194 into libp2p:master Dec 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants