https://github.com/hexarc-software/bn.ts
BigNum in TypeScript
https://github.com/hexarc-software/bn.ts
bignum bignumber javascript typescript
Last synced: 4 months ago
JSON representation
BigNum in TypeScript
- Host: GitHub
- URL: https://github.com/hexarc-software/bn.ts
- Owner: hexarc-software
- License: mit
- Created: 2023-10-01T10:58:53.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-07T14:56:39.000Z (about 2 years ago)
- Last Synced: 2025-08-08T17:24:18.053Z (5 months ago)
- Topics: bignum, bignumber, javascript, typescript
- Language: TypeScript
- Homepage:
- Size: 142 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
BigNum in TypeScript
===========
# 
[](https://www.npmjs.org/package/@hexarc/bn.ts)
[](http://badges.mit-license.org)
[](https://npmjs.org/package/@hexarc/bn.ts)
[](https://npmjs.org/package/@hexarc/bn.ts)
A modern big number implementation in TypeScript. It's based on [bn.js](https://github.com/indutny/bn.js) but overhauled and refactored using modern JavaScript/TypeScript with type annotations out of the box.
## Install with npm:
```sh
npm install --save @hexarc/bn.ts
```
## Usage
```ts
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](https://github.com/indutny/bn.js#instructions).
## License
[MIT](LICENSE)