---
title: "bn.js 5.2.0 Breaking Changes on npm | Since.dev"
description: "What each bn.js release removed, renamed or changed: 6 breaking changes in 3 versions on npm, each with its source."
canonical_url: https://since.dev/packages/npm/bn.js
last_updated: 2026-12-04
---

# bn.js breaking changes

bn.js 5.2.0 (February 23, 2021) is its newest release with breaking changes. The first: Signature changed default.constructor. Every breaking API change we have recorded in bn.js on npm: 6 breaking changes in 3 versions. Below, its 3 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `5.2.5`, released July 9, 2026. [Source repository](https://github.com/indutny/bn.js)

Packages on npm run on Node.js. [Node.js end of life dates](https://since.dev/calendar/nodejs.md).

- From [5.0.0](#v-5-0-0) to [5.2.0](#v-5-2-0): 2 breaking changes in 2 versions.

## bn.js 5.2.0 breaking changes

bn.js 5.2.0, released February 23, 2021: 1 breaking change.

- **Signature changed** `default.constructor`  

Was constructor(number: number | string | number\[\] | Uint8Array | Buffer | BN, base?: number | "hex", endian?: BN.Endianness) constructor(number: number | string | number\[\] | Uint8Array | Buffer | BN, endian?: BN.Endianness); now... [npmjs.com](https://www.npmjs.com/package/bn.js/v/5.2.0)

## bn.js 5.1.0 breaking changes

bn.js 5.1.0, released December 23, 2019: 1 breaking change.

- **Signature changed** `default.constructor`  

Was constructor(number: bigint | number | string | number\[\] | Uint8Array | Buffer | BN, base?: number | "hex", endian?: BN.Endianness) constructor(number: bigint | number | string | number\[\] | Uint8Array | Buffer | BN, endian?... [npmjs.com](https://www.npmjs.com/package/bn.js/v/5.1.0)

## bn.js 5.0.0 breaking changes

bn.js 5.0.0, released July 7, 2019: 4 breaking changes.

- **Removed** `BN.prototype.strip`  

The .strip() method is now internal and should not be called by user code. [github.com](https://github.com/indutny/bn.js/releases/tag/v5.0.0)
- **Behavior changed** `BN.prototype.toJSON`  

toJSON defaults to interoperable hex padded to an even length, which changes its output. [github.com](https://github.com/indutny/bn.js/releases/tag/v5.0.0)
- **Signature changed** `default.constructor`  

Was constructor(number: number | string | number\[\] | Uint8Array | Buffer | BN, base?: number | 'hex', endian?: BN.Endianness) constructor(number: number | string | number\[\] | Uint8Array | Buffer | BN, endian?: BN.Endianness); now... [npmjs.com](https://www.npmjs.com/package/bn.js/v/5.0.0)
- **Signature changed** `default.setn`  

Was setn(b: number): BN; now setn(b: number, value: boolean | 0 | 1): BN. [npmjs.com](https://www.npmjs.com/package/bn.js/v/5.0.0)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
