Node: Native BigNum support

Created on 12 Sep 2017  路  3Comments  路  Source: nodejs/node

Feature request

Native BigNum support (exposing OpenSSL bn library).

Workarounds

Justification

Pure JS implementations have limited performance. Native bn wrappers may have better performance (and maybe more functions).

To be discussed

  • New module or addition for currently existing?
  • API?
  • More?
feature request

Most helpful comment

I'd prefer BigInt because it is on its way to becoming part of the language.

All 3 comments

I'd prefer BigInt because it is on its way to becoming part of the language.

@djphoenix You don't have to wait for Node.js core to grow bignum/bigint support. You can write a C++ module that exposes the BN class .

You won't get nice operator overloading like you do with the BigInt TC39 proposal, of course.

I think there is little that can will be done here on the side of Node.js. As soon as v8 supports BigInt in a version that ships with Node.js it will also be accessible. Before that one alternative would be what @bnoordhuis pointed out.

Therefore I am closing this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fanjunzhi picture fanjunzhi  路  3Comments

stevenvachon picture stevenvachon  路  3Comments

mcollina picture mcollina  路  3Comments

akdor1154 picture akdor1154  路  3Comments

vsemozhetbyt picture vsemozhetbyt  路  3Comments