UNPKG

asn1-parser

Version:

An ASN.1 parser in less than 100 lines of Vanilla JavaScript, part of the Bluecrypt suite.

19 lines (17 loc) 387 B
ASN1._stringify = function(asn1) { //console.log(JSON.stringify(asn1, null, 2)); //console.log(asn1); var ws = ''; function write(asn1) { console.log(ws, 'ch', Enc.numToHex(asn1.type), asn1.length); if (!asn1.children) { return; } asn1.children.forEach(function (a) { ws += '\t'; write(a); ws = ws.slice(1); }); } write(asn1); };