output parsed info with tabs
This commit is contained in:
parent
ee7b0c748b
commit
71960b48ce
1 changed files with 13 additions and 4 deletions
15
bin/rasha.js
15
bin/rasha.js
|
@ -59,8 +59,17 @@ function ASN1(buf, depth) {
|
|||
*/
|
||||
|
||||
var asn1 = ASN1.parse(buf);
|
||||
console.log(asn1);
|
||||
console.log(asn1.type, asn1.length);
|
||||
var ws = '';
|
||||
function write(asn1) {
|
||||
console.log(ws, 'ch', Buffer.from([asn1.type]).toString('hex'), asn1.length);
|
||||
if (!asn1.children) {
|
||||
return;
|
||||
}
|
||||
asn1.children.forEach(function (a, i) {
|
||||
console.log(i, 'ch', Buffer.from([a.type]).toString('hex'), a.length);
|
||||
ws += '\t';
|
||||
write(a);
|
||||
ws = ws.slice(1);
|
||||
});
|
||||
}
|
||||
console.log(asn1);
|
||||
write(asn1);
|
||||
|
|
Loading…
Reference in a new issue