This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Description
I was porting rabin to JavaScript to add support for rabin chunking in the browser - the c algorithm uses lots of bitwise operations on uint64_t types which JavaScript cannot do because lol JavaScript 'numbers'.
I used the long.js module to do this. A passing @olizilla said 'Why don't you use bignumber.js like all our other projects?' 'Good point' I said and started to refactor.
..but then:

Turns out the support for bitwise operations in bignumber.js is pretty poor and there's not a lot of movement to add support. There have been a few attempts but no successes - see MikeMcl/bignumber.js#2 and the issues linked from MikeMcl/bignumber.js#229
long.js has support for all bitwise operations and also in a nicer* way for those that bignumber.js does support (e.g. long.shiftLeft(8) vs big.shiftedBy(-8)).
It's also smaller - the minified versions shipped with both modules are 9.6k (long.js) vs 18k (bignumber.js).
I don't want to propose swapping bignumber.js for long.js everywhere but it doesn't make a lot of sense to have two modules for this.
Anyone got any thoughts? @ipfs/repos-javascript
* = completely subjective