From 95ea9ffa342928a3ca460ed53cd657dd517fc182 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 22 Nov 2018 23:00:36 -0700 Subject: [PATCH] show object ids --- lib/asn1.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/asn1.js b/lib/asn1.js index bb40710..36cf592 100644 --- a/lib/asn1.js +++ b/lib/asn1.js @@ -175,13 +175,17 @@ ASN1.tpl = function (asn1) { } if (!asn1.children) { if (0x05 !== asn1.type) { - val = Buffer.from(asn1.value || ''); - vars.push("// 0x" + Enc.numToHex(val.byteLength) + " (" + val.byteLength + " bytes)\nvar tpl" + i + " = '" - + Enc.bufToHex(val) + "';"); - if (0x02 !== asn1.type && 0x03 !== asn1.type) { - str += ", "; + if (0x06 !== asn1.type) { + val = Buffer.from(asn1.value || ''); + vars.push("// 0x" + Enc.numToHex(val.byteLength) + " (" + val.byteLength + " bytes)\nvar tpl" + i + " = '" + + Enc.bufToHex(val) + "';"); + if (0x02 !== asn1.type && 0x03 !== asn1.type) { + str += ", "; + } + str += "tpl" + i; + } else { + str += ", " + Enc.bufToHex(asn1.value); } - str += "tpl" + i; } str += ")"; return ;