indutny / bn.js

BigNum in pure javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BN.muln with number bigger than 0x4000000

youPickItUp opened this issue · comments

BN.muln throws when called with number bigger than 0x4000000

I haven't came across this information until it has blown up on a website 😢

I wanted to make sure it's true and ask for some warning / info in the README / docs.
I can do the PR just let me know if that's correct.

This is expected, internally BN operates 26 bits numbers, so you need to use mul

bn.js/lib/bn.js

Line 1993 in 5df40f8

assert(num < 0x4000000);

Would be nice to have that info in the docs, PRs are welcome!