Skip to content

hexarc-software/bn.ts

Repository files navigation

BigNum in TypeScript

bn.ts

Version License Downloads Downloads

A modern big number implementation in TypeScript. It's based on bn.js but overhauled and refactored using modern JavaScript/TypeScript with type annotations out of the box.

Install with npm:

npm install --save @hexarc/bn.ts

Usage

import BN from "@hexarc/bn.ts";

const a = new BN("dead", 16);
const b = new BN("101010", 2);

const res = a.add(b);
console.log(res.toString(10));  // 57047

Compatibility

As this library is fully compatible with bn.js you can use it in the same way.

License

MIT

About

BigNum in TypeScript

Topics

Resources

License

Stars

Watchers

Forks

Contributors