BigInt
Enables working with integers beyond 53 bits (the upper limit of what
JavaScript's Number
type can accurately represent).
This is a pure JavaScript library, unlike other libraries that do the
same thing.
Note: This is still a very early version and a lot of operations
are missing.
Example
Here's how to create a BigInt
from a series of binary values:
var BigInt = require('bigintjs');
var big = new BigInt([0xFF000000, 0x00000000, 0x00000000], 32);
console.log(big.toString());
console.log(big.shiftRight(8).toString());
In the future, it'll be possible to create a BigInt
from a string.
Using this package
You can install this package with NPM:
npm install --save bigintjs
To be able to run this in a browser, you need to use a framework that
supports CommonJS modules (for example: Browserify).