UNPKG

asn1-ts

Version:

ASN.1 encoding and decoding, including BER, CER, and DER.

15 lines (14 loc) 380 B
import DERElement from "../../der.mjs"; export default function decodeSequence(value) { if (value.length === 0) { return []; } const encodedElements = []; let i = 0; while (i < value.length) { const next = new DERElement(); i += next.fromBytes(value.subarray(i)); encodedElements.push(next); } return encodedElements; }