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

# asn1js breaking changes

asn1js 4.1.0 (November 19, 2026) is its newest release with breaking changes, 28 of them. The first: Signature changed BaseStringBlock.checkValue. Every breaking API change we have recorded in asn1js on npm: 76 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 `4.1.0`, released November 19, 2026. [Source repository](https://github.com/PeculiarVentures/ASN1.js)

Its 4.0.0 release requires Node.js 20.19.0 or later. [Node.js end of life dates](https://since.dev/calendar/nodejs.md).

- From [3.1.0](#v-3-1-0) to [4.1.0](#v-4-1-0): 71 breaking changes in 2 versions.

## asn1js 4.1.0 breaking changes

asn1js 4.1.0, released November 19, 2026: 28 breaking changes.

- **Signature changed** `BaseStringBlock.checkValue`  

Was protected checkValue(\_view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `BaseStringBlock.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `BmpString.checkValue`  

Was protected checkValue(view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `BmpString.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `CharacterString.checkValue`  

Was protected checkValue(\_view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `CharacterString.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `GeneralString.checkValue`  

Was protected checkValue(\_view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `GeneralString.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `GraphicString.checkValue`  

Was protected checkValue(\_view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `GraphicString.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `IA5String.checkValue`  

Was protected checkValue(\_view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `IA5String.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `Null.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `NumericString.checkValue`  

Was protected checkValue(\_view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `NumericString.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `PrintableString.checkValue`  

Was protected checkValue(\_view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `PrintableString.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `TeletexString.checkValue`  

Was protected checkValue(\_view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `TeletexString.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `UniversalString.checkValue`  

Was protected checkValue(view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `UniversalString.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `Utf8String.checkValue`  

Was protected checkValue(\_view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `Utf8String.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `verifySchema`  

Was function verifySchema(inputBuffer: BufferSource, inputSchema: AsnSchemaType): CompareSchemaResult; now function verifySchema(inputBuffer: BufferSource, inputSchema: AsnSchemaType, options?: FromBerOptions): CompareSchemaResult. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `VideotexString.checkValue`  

Was protected checkValue(\_view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `VideotexString.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `VisibleString.checkValue`  

Was protected checkValue(\_view: Uint8Array): string; now protected checkValue(view: Uint8Array, context?: FromBerContext): string. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)
- **Signature changed** `VisibleString.fromBER`  

Was fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number): number; now fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number, inputLength: number, context?: FromBerContext): number. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.1.0)

## asn1js 4.0.0 breaking changes

asn1js 4.0.0, released October 19, 2026: 43 breaking changes.

- **Removed**  

Node.js versions below 20.19 and 22.0-22.11 are no longer supported. Upgrade Node.js before updating. [github.com](https://github.com/PeculiarVentures/ASN1.js/releases/tag/v4.0.0)
- **Removed**  

Code that relied on pvtsutils or pvutils coming through asn1js must add its own dependency on @peculiar/utils or the original packages. [github.com](https://github.com/PeculiarVentures/ASN1.js/releases/tag/v4.0.0)
- **Removed**  

Use require("asn1js") through require(esm) on supported Node.js, or import it as an ES module. TypeScript CommonJS projects need "module" set to "node20" or "nodenext". [github.com](https://github.com/PeculiarVentures/ASN1.js/releases/tag/v4.0.0)
- **Behavior changed**  

Import only the package entry point; deep imports into build/ no longer resolve. [github.com](https://github.com/PeculiarVentures/ASN1.js/releases/tag/v4.0.0)
- **Behavior changed** `BMPString`  

Decoding an odd-length BMPString returns a decode error rather than throwing, so code that catches exceptions must check for the error result. [github.com](https://github.com/PeculiarVentures/ASN1.js/releases/tag/v4.0.0)
- **Behavior changed** `Integer`  

Pass whole numbers only. Non-integer values that v3 truncated now throw a RangeError. [github.com](https://github.com/PeculiarVentures/ASN1.js/releases/tag/v4.0.0)
- **Behavior changed** `UniversalString`  

Characters outside the BMP now encode as a single UCS-4 code point instead of a surrogate pair, so the encoded bytes change. [github.com](https://github.com/PeculiarVentures/ASN1.js/releases/tag/v4.0.0)
- **Behavior changed** `UTCTime`  

Encoding a UTCTime with a year outside 1950-2049, including via valueDate, now throws a RangeError. Use GeneralizedTime for other years. [github.com](https://github.com/PeculiarVentures/ASN1.js/releases/tag/v4.0.0)
- **Behavior changed** `valueDec`  

Assign whole numbers only. Non-integer values that v3 truncated now throw a RangeError. [github.com](https://github.com/PeculiarVentures/ASN1.js/releases/tag/v4.0.0)
- **Signature changed** `BaseBlockParams.valueBeforeDecode`  

Was valueBeforeDecode?: pvtsutils.BufferSource; now valueBeforeDecode?: BufferSource. [npmjs.com](https://www.npmjs.com/package/asn1js/v/4.0.0)

And 33 more in this version. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

## asn1js 3.1.0 breaking changes

asn1js 3.1.0, released October 16, 2026: 5 breaking changes.

- **Behavior changed** `GeneralizedTime`  

GeneralizedTime values with fractional seconds are now encoded in DER without trailing zeros, so encoded bytes can differ from earlier versions. Code that compares or stores encoded output may need to be updated. [github.com](https://github.com/PeculiarVentures/ASN1.js/releases/tag/v3.1.0)
- **Signature changed** `HexBlock`  

Was function HexBlock\<T extends LocalBaseBlockConstructor>(BaseClass: T): {new (...args: any\[\]): {isHexOnly: boolean; valueHex: ArrayBuffer; valueHexView: Uint8Array; fromBER(inputBuffer: ArrayBuffer | Uint8Array, inputOffset: number... [npmjs.com](https://www.npmjs.com/package/asn1js/v/3.1.0)
- **Signature changed** `RawDataParams`  

Was type RawDataParams = Partial\<IRawData>; now type RawDataParams = {data?: ArrayBuffer | Uint8Array;}. [npmjs.com](https://www.npmjs.com/package/asn1js/v/3.1.0)
- **Signature changed** `RawDataParams.data`  

Was data: ArrayBuffer; now data?: ArrayBuffer | Uint8Array. [npmjs.com](https://www.npmjs.com/package/asn1js/v/3.1.0)
- **Signature changed** `ViewWriter.write`  

Was write(buf: ArrayBuffer): void; now write(buf: ArrayBuffer | Uint8Array): void. [npmjs.com](https://www.npmjs.com/package/asn1js/v/3.1.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.
