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

Do you support very large integers (256 bit)? #158

Closed
jcalfee opened this issue Apr 7, 2017 · 3 comments
Closed

Do you support very large integers (256 bit)? #158

jcalfee opened this issue Apr 7, 2017 · 3 comments

Comments

@jcalfee
Copy link

jcalfee commented Apr 7, 2017

No description provided.

@fanatid
Copy link
Collaborator

fanatid commented Apr 7, 2017

Yes. For example bn.js is used by elliptic.

@indutny
Copy link
Owner

indutny commented Apr 7, 2017

There is no limitation! 😉 In fact the whole library is optimized for elliptic curves that work with 256-bit numbers.

@indutny indutny closed this as completed Apr 7, 2017
@jcalfee
Copy link
Author

jcalfee commented Apr 7, 2017

Great! I'll start using this then..

I found an example that is 45 hex digits so that shows over 256 bits work.

it('should accept long base-16', function () {
      var num = '123456789abcdef123456789abcdef123456789abcdef';
      assert.equal(new BN(num, 16).toString(16), num);
});

It might be good to put a note in the docs just so someone browsing through the libraries can be sure..

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

No branches or pull requests

3 participants