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