Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commented generates improper comments #114

Open
ashisherc opened this issue Aug 4, 2020 · 15 comments
Open

commented generates improper comments #114

ashisherc opened this issue Aug 4, 2020 · 15 comments

Comments

@ashisherc
Copy link

I tried using commenter, eg, require('cbor/lib/comented'),

commented.comment(cborString, function(error, string){
console.log(error, string);
})

This does not invoke the callback function, have tried with an options object as well.

I also tried commenting a cbor trying using cbor-cli and piping the output to a file, the comments generates are not proper and does not follow the ones as cbor.me, I tried with a couple of cbor strings, but below is a sample cbor that does not comment properly,

82D818584983581C9C708538A763FF27169987A489E35057EF3CD3778C05E96F7BA9450EA201581E581C9C1722F7E446689256E1A30260F3510D558D99D0C391F2BA89CB697702451A4170CB17001A6979126C

@hildjj
Copy link
Owner

hildjj commented Aug 4, 2020

I can't reproduce this. The following code works fine for me:

const cborString = '82D818584983581C9C708538A763FF27169987A489E35057EF3CD3778C05E96F7BA9450EA201581E581C9C1722F7E446689256E1A30260F3510D558D99D0C391F2BA89CB697702451A4170CB17001A6979126C'
cbor.comment(cborString, function(error, string) {
  if (error != null) {
    console.error(error)
  } else {
    console.log(string)
  }
})

As does the equivalent code:

cbor.comment(cborString).then(console.log, console.error)

We can argue over what the output format should be, but a) it's not standardized, and b) it's at least not wrong:

  82                -- Array, 2 items
    d8              --  next 1 byte
      18            -- [0], Tag #24
        58          -- Bytes, length next 1 byte
          49        -- Bytes, length: 73
            83581c9c708538a763ff27169987a489e35057ef3cd3778c05e96f7ba9450ea201581e581c9c1722f7e446689256e1a30260f3510d558d99d0c391f2ba89cb697702451a4170cb1700 -- 83581c9c708538a763ff27169987a489e35057ef3cd3778c05e96f7ba9450ea201581e581c9c1722f7e446689256e1a30260f3510d558d99d0c391f2ba89cb697702451a4170cb1700
      1a            -- Positive number, next 4 bytes
        6979126c    -- [1], 1769542252
0x82d818584983581c9c708538a763ff27169987a489e35057ef3cd3778c05e96f7ba9450ea201581e581c9c1722f7e446689256e1a30260f3510d558d99d0c391f2ba89cb697702451a4170cb17001a6979126c

I get the same output from cli/bin/cbor2comment -x 82D8..., unsurprisingly.

@hildjj
Copy link
Owner

hildjj commented Aug 4, 2020

Is your argument that the commented format should dig into tag 24 and parse it as well? I'm open to that.

@hildjj
Copy link
Owner

hildjj commented Aug 4, 2020

Waiting to hear back from you before I cut a release with the patch above. It now generates a (still ugly, but arguably more useful):

  82                -- Array, 2 items
    d8              --  next 1 byte
      18            -- [0], Tag #24 Encoded CBOR data item
        58          -- Bytes, length next 1 byte
          49        -- Bytes, length: 73
            83581c9c708538a763ff27169987a489e35057ef3cd3778c05e96f7ba9450ea201581e581c9c1722f7e446689256e1a30260f3510d558d99d0c391f2ba89cb697702451a4170cb1700 -- 83581c9c708538a763ff27169987a489e35057ef3cd3778c05e96f7ba9450ea201581e581c9c1722f7e446689256e1a30260f3510d558d99d0c391f2ba89cb697702451a4170cb1700
          83        -- Array, 3 items
            58      -- Bytes, length next 1 byte
              1c    -- Bytes, length: 28
                9c708538a763ff27169987a489e35057ef3cd3778c05e96f7ba9450e -- [0], 9c708538a763ff27169987a489e35057ef3cd3778c05e96f7ba9450e
            a2      -- [1], Map, 2 pairs
              01    -- {Key:0}, 1
              58    -- Bytes, length next 1 byte
                1e  -- Bytes, length: 30
                  581c9c1722f7e446689256e1a30260f3510d558d99d0c391f2ba89cb6977 -- {Val:0}, 581c9c1722f7e446689256e1a30260f3510d558d99d0c391f2ba89cb6977
              02    -- {Key:1}, 2
              45    -- Bytes, length: 5
                1a4170cb17 -- {Val:1}, 1a4170cb17
            00      -- [2], 0
      1a            -- Positive number, next 4 bytes
        6979126c    -- [1], 1769542252
0x82d818584983581c9c708538a763ff27169987a489e35057ef3cd3778c05e96f7ba9450ea201581e581c9c1722f7e446689256e1a30260f3510d558d99d0c391f2ba89cb697702451a4170cb17001a6979126c

I think to make it prettier, I'll need to get into wrapping, which will be fiddly to get exactly right, particularly with more deeply-nested inputs.

@ashisherc
Copy link
Author

Is your argument that the commented format should dig into tag 24 and parse it as well? I'm open to that.

No, I think it should not dig into the tag 24 by default, the tag itself might be of some interest for some.

@ashisherc
Copy link
Author

I can't reproduce this. The following code works fine for me:

const cborString = '82D818584983581C9C708538A763FF27169987A489E35057EF3CD3778C05E96F7BA9450EA201581E581C9C1722F7E446689256E1A30260F3510D558D99D0C391F2BA89CB697702451A4170CB17001A6979126C'
cbor.comment(cborString, function(error, string) {
  if (error != null) {
    console.error(error)
  } else {
    console.log(string)
  }
})

As does the equivalent code:

cbor.comment(cborString).then(console.log, console.error)

We can argue over what the output format should be, but a) it's not standardized, and b) it's at least not wrong:

  82                -- Array, 2 items
    d8              --  next 1 byte
      18            -- [0], Tag #24
        58          -- Bytes, length next 1 byte
          49        -- Bytes, length: 73
            83581c9c708538a763ff27169987a489e35057ef3cd3778c05e96f7ba9450ea201581e581c9c1722f7e446689256e1a30260f3510d558d99d0c391f2ba89cb697702451a4170cb1700 -- 83581c9c708538a763ff27169987a489e35057ef3cd3778c05e96f7ba9450ea201581e581c9c1722f7e446689256e1a30260f3510d558d99d0c391f2ba89cb697702451a4170cb1700
      1a            -- Positive number, next 4 bytes
        6979126c    -- [1], 1769542252
0x82d818584983581c9c708538a763ff27169987a489e35057ef3cd3778c05e96f7ba9450ea201581e581c9c1722f7e446689256e1a30260f3510d558d99d0c391f2ba89cb697702451a4170cb17001a6979126c

I get the same output from cli/bin/cbor2comment -x 82D8..., unsurprisingly.

Yeah, it works fine. I think I had a character typo in what I was trying.

But, I think a few things can be improved here, eg.

d8 -- next 1 byte
18 -- [0], Tag #24

this can be printed as d8 18 for the readability,

similarly
58 -- Bytes, length next 1 byte
49 -- Bytes, length: 73
this as, 58 49

This isn't required to be incorporated, you can release.

@ashisherc ashisherc reopened this Aug 5, 2020
@ashisherc
Copy link
Author

If possible and sounds ok, can you please undo the change that digs deep inside the 24 tag by default.

@ashisherc
Copy link
Author

Looks like the commenter is not able to comment a bigger cbor,

820284828f1a004494581a0045c0cc5820d5f1ac18bdcf817fd2a944a9157824cc70e87ae78038b0cacab0c9a6f93ea7a658209180d818e69cd997e34663c418a648c076f2e19cd4194e486e159d8580bc6cda58206d930cc9d1baade5cd1c70fbc025d3377ce946760c48e511d1abdf8acff6ff1c825840b64ffcdc73ebdc05f622c558b473b4c16f5a85fb7342a4c0b946bdd24c231ef73e3319924756b7cc1ea46040cde51c7271f0b4a7316a14a77e956bdcbec35e38585025d808e1066762c5c1a956b309f3bdf934f08de82dbffac50fede118c23151b25f3a0972183529c3a05c722bb1bb4fba6556e226d3278c56ae8cee8f6a39e8f6665c281cd11224ce6d059d6e5d1bfd048258400d83cc67c6e886931e7019ce9e882cea06782108d6e36a6127a3831366f3f032baf98470bb670e568a425dc8131ab67bfdedbef8dbc4c8921d8bafcd61d62b61585061f9901b3e69ac973cbf3dfcf2fdaa5387d75efaaf5f0b29850a84e499a4de6a279b08ddfe24db850044c65891d91788a0dcb5fdf7fa68879694c30b6a5dcbabb7e253562fdad0fe772666a7c0b5330019089d582022303cf20c87db4051e2f3b8f013a4db9e10cdc4629a0956d9fc1c0da9bdd6325820ae981f4a58d135f98d0a0c5aab9fc04944c8409f65187f9778b57905e43769570000584008d56fe9c28eeeb99bda8920a9887f468f1d74bb03c37ef3caffffbee68d88eb33341498ac145a2422c77546db61c2da782587cdf934d69b113ce52ab8bd8b0b02005901c09830538d30e3c3445d4c3f8bd2622d6299838800167f5ce6451f1f3ad13a13a82664bb11230e5c83a9c2c665ec0a4a1a1562caedd08e1334d8deffaa86d7f2096aa7e738e9381ebb86baf842af4ee229a3e3908cfec16153f1dd5e21dba0316e7625e4c2a8db495d80ca3c93862fcf4ad0a8a79a20f7d3d9733f9dccbb8ac6d623bbec2bb6dbf170a3c33d32a15d2cc02b3ce78c8d61af768fa82067254b2fe3bd7a1e5cdacf71b50998eec98a48b6970eacdc74d5ae40224f95850fbd88df96e192767c641a70ebf2bb9dc7d32a1e36d1113c09f5591622b35aed5c06bf7b894b882c56bd8e12b7da5b16a341e59d3239a3d14f9d0a5ac006dfdc258e215eacb563954ea234797754b9276f9746d1d6589e10f0dfda8130d422db636d02dec7c8b45ff97de40ac541421e3f2d1aed4246cc5bb54600fa567275046a979f3b4d067c0869732129234df68f1150b09285ecf71385034c79ace9e74186bd811770fcd43a449aa9466165731f92ae73ba4ef9c665a1f8851420a8b1568b711fabca735f474a6a800751f73fbbb3ed2ace0c8bdb2c14eed4032b085dd0ac8f6b0d984a441d337ffe6903aa794728a56360e106c84fc1b943af0e383fd1f1939a241683a400818258204dafd1f2aa0346c451f016a2fd352d73d42300cc94f759202d18c7987b989a6d010181825839017296fb0c05c362f9544ef3bdd11ba56deb15b2d7c4928900412d61f7edf53b1553ab36f04c5ee49c2d8978a48e39b10bf67c16003db7aaa81a1eaacd1f021a000293b9031a0045dcd8a500818258209186db304c942c2f17533a29d1a32cdde44484ec112ed6fdedf3987032a11f990101818258390174c7eeee7482ea3f4117d709c06f24fce62ddbf7751d07751b99cae15187f10e55680754019f12e82cf9f59853d8038a320c8bb8996f99271a3700cafb021a0002a8b1031a0045dcd8048282008200581c5187f10e55680754019f12e82cf9f59853d8038a320c8bb8996f992783028200581c5187f10e55680754019f12e82cf9f59853d8038a320c8bb8996f9927581cc73186434c6fc6676bd67304d34518fc6fd7d5eaddaf78641b1e7dcfa40098238258205e96526541ac8afb7ed39262c1dc72cf1dacef8a9c694f1f25f3ebd935d2b4c507825820355d4e795e3453554407010afc4fedd411dfd18f10589a0407c7335cf947faa003825820b3d29fedca5d6a098cb383c11e7e0cca97bc391235af55f9d686477bd90d6e7404825820d2d5ba4c246330c5ca9009af28327af72565fa1430f0b6b9de6eb29c7db19ae4028258207c05f1d0bb506d6cf4b32e624ca2e0d66520e09baee4c14ad716ef613dddc77202825820b3a47c852eb0b67ccd73c30dc7fe8ff795659fe8427aa95dc52878dd1fa2cf250582582073f16b4399ec53dd2c7ba93c2b5210fc9d0681a5ae0055286c774f977311385302825820a225680d16ad33c62b0a36ee79586efe431ddf5792d6164ebf18a0ebb0608cf302825820c5e47fadd1bf2c2ada5c049a363b152836ba3fcc0eacb7062ad0d632f3b3291d048258201c1b6e047a3b6065251fbce7fc3ccec19b43abbc80f94b7c70acdbee8f52e5360182582033d10c7f0a0d8cb57690a376b6b4d45bbb970adf36218cba37346034d7d9cabd028258200991c0f211b26c3769bf47a34e81ee3df2e27f47a20c1b5bf96efb0268342d3207825820056323f4d3f93909661f6438988015278905f3ece6f4ca0786e823df8437b011028258200e554bed63a4a41f9883093cc4180515c11dfd6f685c78ce100d32d3c9e337e5008258204300c9ce092cb2d697f2410c5aea02c48044b1f6459b51a7f6a447feb06a2f9704825820f16f57e4bff32e9d77122562139f80e14653359a6a78193c20db115d63d9f8b3058258202493aead4087b9eb9119fa35af5a4e5bcbeb7dfea83b4dd1671a2aef693cc1080182582007f95f334d0f3e8a3cd4f4f21903d4a4857a4b681a5ca57e763bdb85c273041700825820bc47107d391a55391489554e69b61425274041b66decdc503c080a8482ee6de203825820008e4c8395618098f424fc9fc5e169248604c137c9e625d03a0315884bccd6cd03825820113f98e8c62cae455c1066ab2e3932cc8b9c8e9b6e0b4946254e0db05a2065ee0282582058cf2f627b7673e21e5e71ac321a4b03d97b01328e655d23c9d3c910560ad3aa04825820c4febd98f0957a7370e1e5f7d67b2f370f0ad84031745aa55c2a345142abf4f400825820bc28c2576d97df8ee1191300d483845aed5da7cf252a6ce23242e9c53005c31d05825820bb5e03b9228c8e6c4b7a7737a32ad6fdcf20f7ee03a41be63f3e33f2c30746c10082582082207f6d0da5fadd981658b239b497433d404a6bca470e81304dddd8def952cc04825820d06a8b24fe09a9f876429708de4f016a6f313ca2992852e70073ffef7ffde15c04825820aa61b49dc5b71bc1e4e9fa793fad44e4ee3e925ec3b5a8fa2d464d2d9d35496d01825820ea3d6f75d24847505de42b3f3ce817b7df28b9a0a5e2c1e2955152d11b3755dd03825820114bfdd871483a20dfdc07afca23a08d88bd8b0a41263e832d13d163332a59cf00825820073d0b524d506eb2363e1dc2f8db0978e91adc404c0748d4cccacd43635b821500825820c6e20ff115c5d5ee3d5c49ba1e34dbfa8b9975018260cbd3b85abd23006630720282582003fbaa88cc9b3320058f1044f07ae9d7cf8f3c6f8cbeebf6a2a88d683bd4d9ce048258206f150138e0ac698edbdbadcb73ef94b099a0d9f4e4d66aec0e09706d74c0f270038258204d019ec6e1a133629c4c843ba34b91edb618c2b1d9b0bb3a2631e9084fdcab450701818258390199f3ca9ed04e3cbfbc071e7488a67f9bced5b3552babdc09cc2bc4225e24b33cf2b3ef9f828a7da937d40fce5cdbf0bde4aa7ae4b630c49d1b000000eb4bb0f391021a00069008031a0098968083a10281845820538e1d8b312870977e6fd6b9a399a8d35ceeb7b45bf427087a23b5a9b3859eb058402adbf4eb0651c6cdb2e657765f7c092579c903b6d04e71c3fd9ff29724dd61dcae4294c1455990712d40c0da29321ba9f5d0dc129e26cc613f027d536befcd0158201f79fc141c7afff1f0429136c877ceda5c7ca11db40ac99d3331c7082b97d4c85822a101581e581cb9140e1207e026dcec33cb8728758f6e700c691420fccf70e3d592e4a10082825820b730ab65096f121f4d63975571e2421a48eaf52b6a982f4318fdb63d2ae66ee358400c3b9259bbfa66283fc6bbab61550eb1ac7adbb3f517159ab948c19551207916379e5074cc7cf5b7bc6d71e71f9d22b076c35e308db5dded0b1fd8212faddc0c82582014a6cd9421616459efde544c9f08f79756a172f6b7d3302a167926a4e7505cc15840be6a4dd989eb6f18f7b020b7df4d6e7ac82671addafb23525d89544ab583da217aecb1f4fcc168619777cd059bbcfd6a6945a6527bd15ca1a4b57659a227560ca10281845820dc38a08d70776c6258d59989a2bff88aa4c5767477ff970fb233a6d3d8de6c2a58404dc806c749e9d2218f77463126a0eebb6848f77f1149cd56717447530566db686e68eb54ca8070fa0e973365d2ac5420505ae4d9c1ec6bac20c904f0548f0c005820ba572750efa876f560925e8b6d3626c35b82e41db92ba52c5acca960952d716e41a0a0

This parsed until only half somewhere.

@ashisherc
Copy link
Author

ashisherc commented Aug 5, 2020

After further investigating the depth is not coming back to 3 after the first 2 items in the second array. I have logged the depth in the commenter to debug the issue. there should be 4 items at depth 3.

@ashisherc
Copy link
Author

Also the commenter is not working for this valid cbor,

820284828f1a0044851f1a00448f54582068148639a524fda24332a0d00538bc816513e90b14e925df232acbfbe2ded69b58208b53207629f9a30e4b2015044f337c01735abe67243c19470c9dae8c7b732798582090561cf5fb4eada778f0564060b9b5138fbfa50c0e74fc496956c8c3507301a6825840250d9ec7ebec73e885798ae9427e1ea47b5ae66059b465b7c0fd132d17a9c2dcae29ba72863c1861cfb776d342812c4e9000981c4a40819430d0e84aa8bfeb0d58501f2a57b1d0c67e1a952681134800d949db8dd108838fb8f4cc0eeec00263b8bebd6082cd8a975f427d6aade7fb5281b2c1b7a8e351e2ce649a2f64b4f454a61c4c8cd3664173606fac5e392077b5150d825840a03a2b5b2dede6d6c66a76d361e113cc4e4a2f4855404617a7fb5173dd8cc6ccef0405b06ba63eb777927c46f25b7ffaf696e2d5deae10980f4730b869688b235850296967fc5772b844878b0c8e9a7cf96835848c8d8a3c1d98d7d61fefd15eb07972db96a1fba3212c68f0887548faf8b436b7d7fc16abf143ef68d5b43cf36c5750420e932c99addb4d1f7ec405def10b190dcd582086a2e7859b4b00d6413604712ad3f6edb53a4da42031e0414d3e8019a72088c358201af49b4e4cd6d87826b1b0345e4eff53b2ff3d518bb3e3e173c711cedf97dae00000584078268d3523e686d35c92998a1fb92713c712ee61b7b8e45d645c5a4a34b509b5435f33c13d9d2d9e71b27db1ea9933bf9d49f75bd056ded22aa65543910c7a0a02005901c09f8dde9a08a7b0797a97af982658820533b6609efdf41e482d1757dd0fed06832aa68487e2ef4b9c189d68fe45994ad91dd0a1cb5c3e193eb19739fff107f3038bf3f88ac78bfa07cad335728a9e92b3f0056dc6a0759f5eea8203202ced9620542fdd9f7e9cee10ae07d729197a6342a69f6a17adeb11471f712b82f1c03d946667fc9e541a1bd237fa19b8cf7fdf39523d9ce45569ad12d6af962f5accef131f05a02eff14ef7c5dc2c38fa5f22847336efc00f1c6b1d8761421bb7b896f0fa7dd52eadf10efbae5abf9ed5b6b418de89cf87adff3e2206177e26a3afd3363a5930e242762defc29af730f89d4faeceae30ec3070cefb03d036b9fefe9dd7d4c01b382752890b62fabbf855f6806a2889b96b6fcb24409f10531bed5a0667e8dac3f9a49a54747b43ef35cea8b8084bd9f4d13e211138b65e081f391326e366ac97d34b7995169e15d259060522b74e612a1247cc05817bbb233a0d7c46be5048fbf2bb00f7a4ca8ade11af399ea94d09c049c0e7d4fba9f458319c663854674f5e889c11ffc5828edbe3666318580692a26595a0244e0baade8009e3943a48602cfde35a979786e0998a1c1a565a5183cb427ec3fb786dddbf157243b7d3e82a4009282582000fef9a95eab31dd59325efb44b924c461314bf838620c0fe8fab2fb1192cd6c008258201012d68dd061424828f4e456c565bcfc6ea306c5f588b0c30c2fc94bb8eadddf028258201efc1019665d763bdd4f904445126585fc78ee3faf8a87316c2d088054e12566008258203991cbd7f6a1bfc2b512fbe42d2fc27dddaa14712209cac7f68a317e0729562f00825820463634eea32c00ecb9e7639a0117a295d0d9daf2af4fce81e63548794a20a8b30182582059f68f08c2c34c0ffbade21955bd568775f5ee1c21c5274d97d3e391babfbecb0082582060d5075c709723b83432a42db7aa7112f2188eda9cd9439e2774e9047ef4fca500825820639482c1d9ab8bce93dfcef556cb554f07108d3cdfb8a9f404f1d1692e7322f9008258206b8c09e6fc5e6ba544f9b232f81a63f1d18fc83f39e13c605314b4b13fca1bc807825820796a333f2e607009ea8b8599bc1e414714b82b78160338a3ee6ff9a111b0550b008258209cd36712c03d1bf5e2f6a4954ba13a66fa37241c9a55fc2766cf9cb8d8e400b901825820a15e74d0e67c17d2f6dcc679a3b00077174c1dcf3fd831bebd78da7587abee5909825820b1c2768b4f0c4a98222ea8165b3fd81deed1fee0ddf1567321c36d8a59c20bd701825820b63ad31ce83c64f72477ba1bdbaccb2f0f7a084f177767ea3fef23b959daef8601825820c7ecc450115bb1fcd03baeef2695f9796df0156a24e73c54da83990e4b19402c00825820e41fb214724ce2b95f66567158f8574b468aa30b196cf5a069fc31ee18811df200825820eeefab68d05d6312a91587496a58ca51dd867f1fb6010f16db5d056e8237962400825820fab86937fd4a120694c7bed9e95cff9a118ab729e7e3f3d4db4eb7be1b460a3601019282583901473624b4c0fe6828b72cd97345320d1ae5d68d4fe92a2cbd96cf7b83ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a23ae362b82583901af43f352330570f5541f55d509cf6aa006e9783b32d27794f3ac1b53ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b00000023668753008258390159b234a5b81b92c67c3dd8c8e734cc86dc27262e087669de1ea43171ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a3b9aca00825839013dc53de0e94cdf65d21770b182af415cf8554a30e7e079c2e9ad4eddff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b00000002204a39f0825839012dddd22fb035183d740e8e1aae71c1624967ecd9c07800c1a83a9a29ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b0000001b646db74282583901ec8872125df29a7740c02a7051fbc4296cca51944d41b1a819732db7ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b00000001852570d782583901be835636a208ec22bf164dbdd4d618b761d37358e8be04b619691032ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a0ee6b28082583901eedca1c715fa475953b027a01fd05419369d3c6dce6f13cc7a780267ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a1dbe22c082583901744602c28e50bff456a82ae3f2016dffc9c6685381311d9e249cc24eff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b000000129095126082583901eb92385a5b600867a57599c39680c2cb43007d2cd969349c8eb18803ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a3b9aca00825839012a2627bad51a09f5b3c1c97945abd03863c98084f8ffadeb878d9dabff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b00000043aa0716408258390125e916df2d055b4b5a4fc1fb5e5f06ae569aaace0ae76fd28b9f2465ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b000000043245bba0825839018042a91766ab6a926f7eb61b0c4633e49b6eb57ae9816cd03f961d21ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a1dcd650082583901c4b14506f0d41421ad6d7a9b225a18c08cab7f93106892d26aec6481ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a11e1a30082583901f712d1e7550ee536a81f335ecb682477d8b3337c12dd181f87a3fb59ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a21bf369d825839018400acd8c660e25e37d152a1f5c6213139fa473f7e533b62feae5f81ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a1dcd650082583901e4b1fcf8f2e1b353abe4e6ce8fad6040fd3015fdd5fbf49c7a9bee65ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a05f5e1008258390182aa6f058e0bd9d4387c0f6c110c4aab3ee40a8c5eb75e4b61f72cbdff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a1dcd6500021a0005cd95031a0044ab60a40081825820241ffd29c5a6477ad721a18975526481c4f0be049a8fe4aac3b5270ce84b494801018182583901e97945b695b2c3a050ea58481ec26021b1e1a1b6ad26ccd2e2473c6bae4aa4f6e3ec89978e226fd44dab52e84705384b40db13af9627bc061b000000012a0ab1b5021a00029469031a0044ab6082a102888458203806766194d98b7add44551ae05d0ae289afd2d24ad5f07a7b357c74005a4bfd584027d9fff7319e0c753ce5e3129d11fda3af4954ddd09186f1ec6a2fc78dea18f69036288983c8be26649b1d14b7fde106ec1a0a13984c0215caaeac2add03d40258207835b5aa8dde8ff1acf95c76062a8c1e7cf3ed0d5edab612d0a627b7959fbab25822a101581e581ce0d2e88fe9acc921b6a2112cdacac682f9796dfc63cee6cc5b994e0c845820228c59561507bcfa74fe598cba2606051710460affeb46b9b8fe52cccd5f4ea05840bd66d25bafe95d81652da718b23e3b6cdc9496eb2176cb3d1a93bba3248f319acde888d0602537ba32c1ca0e7fb59bdd0d34243d5d80ef8eb580d1d5b4b2bf005820947121d1ae2a49d67b1995b006195810c6bc9431cc7c513c573e5f5622cfc46b5822a101581e581ce0d2e88fe9acc97c16c34c2c5d6f42432d3d93ce82e311d2a2e4f98b8458202cc1504e58feb072920b34ae13ed4fe637bccfa5843954911df8273959dfb19e5840fc715894ce8b8fe22d001d5aef54876dfcfc3c0fe69467505eccd256220e8ea90d918e48bd16ea77972ee3eab40d2d4edf0c48393e04f3189050754f6a3a740858205df57bb5b62905e66b8655e7c2bdb7494a900c8b13068d2baf25118c0f6832085822a101581e581ce0d2e88fe9acc91bdc31b72c1ba9b932f9613cdc014a5d205fbc5d3d845820a61fe2310790a6a7af63e59ccd8281e68a9ec22f947ef6e4da65be26f706805b5840517899cb22a051b99dff98ca3d90b8ac374c2da97e7c36e2818c5769d745cd130bd6a44455c15a686d5ba986fc7e6b5334f727e9f83cd080b3a612174e49ad0e58208a4fe2d4e0693b7f758f2faa6c74d80bded18e62572924787f98f9694b8982685822a101581e581ce0d2e88fe9acc906a513472cfe80079ecf2dbaf50a09a0590dea4f8184582027db61206bc0cddaa8212056a8309cf30bfda8d708a3c2e4723a3053ffc88dfc5840278d8468993cc8e055cf518f86c3b4ea8ca3f1085df10c5d0ac844a5b8c2e2aad41506938e545c4f1d2ae1dba6065e38272d3fcd6d1ee3bf1817bad0652d21025820bdb5b547954a8af5df9a9c38eb78b34f8a94355c86925778bb7dad76fc32a5cb5822a101581e581ce0d2e88fe9acc92f4da90b2c76539da339ad0575df0eced864c388258458203f9e179cee15891ec803a5376c027045648e583019e7a27b2aa80b80eaadcb0c5840749ddd93c8247142d092ad7859d6ef408032740ec5b5856687787c04b3820c6b025c7249d1e1ba732fce1794e65e6cd5393067d1b1e8edc8926274f303193d0358207bdd34034bf2babeb038f84632c0bafd5683c72d443aa645c47a5fde647e31325822a101581e581ce0d2e88fe9acc97bce98942c8bd5e370c7b304c1859f3cc9f3bc69b1845820402ebe96158c31abccfaed41f430a4a2699452382b5d37a37c8109c070d2a14e5840154903f2d817c1681f9eb9032617d7f8ad3f5278a1cd59fe9e2960d2651bb90f9c9893f1922b9716b2499c1172da9345ffc86d543ae3de37e8ffaf64389a690058202e8bda7f7b87117dd5763fad087d4121c5022eace06425a291eef90a7639f5005822a101581e581ce0d2e88fe9acc96d0385562c4496150c83b08de620732f7bb516f5a68458204bcb8bde6545670f541555a319d17668c3f1a4c4eda8cd26b25c23ee2463a0c858407080290c0bfc4b9e73c61cde89d963a9965caf67440224622f492abcd234f9af79c58eaa0e8c0e69cb3aeb44c1074bed543ec53b026e9236c50c7301bf49580d5820ebdb707645aeca63ef9ce403cca460b453fc408e35865d4b979196fdf98290b75822a101581e581ce0d2e88fe9acc93ece03772c88331dad1dce579409036b25defd6771a10281845820cae5f2d9032a21b0d872eb9ab8e80df907c85c42611f3599d31eedbadc9c0c4a5840ef518b383daab40ad8310a26c349d368d9f6ae56e1866fdec03f9db903e6dcf169ea7b08dc47776580afbd8836006a71b8712834759bf7291b90167533a6fd0b5820ed6665aba663529088690c264aca85dec22075a2e77ab3080cd13f040015c2835822a101581e581cb1fa7c35461241a8052e481e0e80d8a4f95839c76c243ff40daa3135a0

@ashisherc
Copy link
Author

Also the commenter is not working for this valid cbor,

820284828f1a0044851f1a00448f54582068148639a524fda24332a0d00538bc816513e90b14e925df232acbfbe2ded69b58208b53207629f9a30e4b2015044f337c01735abe67243c19470c9dae8c7b732798582090561cf5fb4eada778f0564060b9b5138fbfa50c0e74fc496956c8c3507301a6825840250d9ec7ebec73e885798ae9427e1ea47b5ae66059b465b7c0fd132d17a9c2dcae29ba72863c1861cfb776d342812c4e9000981c4a40819430d0e84aa8bfeb0d58501f2a57b1d0c67e1a952681134800d949db8dd108838fb8f4cc0eeec00263b8bebd6082cd8a975f427d6aade7fb5281b2c1b7a8e351e2ce649a2f64b4f454a61c4c8cd3664173606fac5e392077b5150d825840a03a2b5b2dede6d6c66a76d361e113cc4e4a2f4855404617a7fb5173dd8cc6ccef0405b06ba63eb777927c46f25b7ffaf696e2d5deae10980f4730b869688b235850296967fc5772b844878b0c8e9a7cf96835848c8d8a3c1d98d7d61fefd15eb07972db96a1fba3212c68f0887548faf8b436b7d7fc16abf143ef68d5b43cf36c5750420e932c99addb4d1f7ec405def10b190dcd582086a2e7859b4b00d6413604712ad3f6edb53a4da42031e0414d3e8019a72088c358201af49b4e4cd6d87826b1b0345e4eff53b2ff3d518bb3e3e173c711cedf97dae00000584078268d3523e686d35c92998a1fb92713c712ee61b7b8e45d645c5a4a34b509b5435f33c13d9d2d9e71b27db1ea9933bf9d49f75bd056ded22aa65543910c7a0a02005901c09f8dde9a08a7b0797a97af982658820533b6609efdf41e482d1757dd0fed06832aa68487e2ef4b9c189d68fe45994ad91dd0a1cb5c3e193eb19739fff107f3038bf3f88ac78bfa07cad335728a9e92b3f0056dc6a0759f5eea8203202ced9620542fdd9f7e9cee10ae07d729197a6342a69f6a17adeb11471f712b82f1c03d946667fc9e541a1bd237fa19b8cf7fdf39523d9ce45569ad12d6af962f5accef131f05a02eff14ef7c5dc2c38fa5f22847336efc00f1c6b1d8761421bb7b896f0fa7dd52eadf10efbae5abf9ed5b6b418de89cf87adff3e2206177e26a3afd3363a5930e242762defc29af730f89d4faeceae30ec3070cefb03d036b9fefe9dd7d4c01b382752890b62fabbf855f6806a2889b96b6fcb24409f10531bed5a0667e8dac3f9a49a54747b43ef35cea8b8084bd9f4d13e211138b65e081f391326e366ac97d34b7995169e15d259060522b74e612a1247cc05817bbb233a0d7c46be5048fbf2bb00f7a4ca8ade11af399ea94d09c049c0e7d4fba9f458319c663854674f5e889c11ffc5828edbe3666318580692a26595a0244e0baade8009e3943a48602cfde35a979786e0998a1c1a565a5183cb427ec3fb786dddbf157243b7d3e82a4009282582000fef9a95eab31dd59325efb44b924c461314bf838620c0fe8fab2fb1192cd6c008258201012d68dd061424828f4e456c565bcfc6ea306c5f588b0c30c2fc94bb8eadddf028258201efc1019665d763bdd4f904445126585fc78ee3faf8a87316c2d088054e12566008258203991cbd7f6a1bfc2b512fbe42d2fc27dddaa14712209cac7f68a317e0729562f00825820463634eea32c00ecb9e7639a0117a295d0d9daf2af4fce81e63548794a20a8b30182582059f68f08c2c34c0ffbade21955bd568775f5ee1c21c5274d97d3e391babfbecb0082582060d5075c709723b83432a42db7aa7112f2188eda9cd9439e2774e9047ef4fca500825820639482c1d9ab8bce93dfcef556cb554f07108d3cdfb8a9f404f1d1692e7322f9008258206b8c09e6fc5e6ba544f9b232f81a63f1d18fc83f39e13c605314b4b13fca1bc807825820796a333f2e607009ea8b8599bc1e414714b82b78160338a3ee6ff9a111b0550b008258209cd36712c03d1bf5e2f6a4954ba13a66fa37241c9a55fc2766cf9cb8d8e400b901825820a15e74d0e67c17d2f6dcc679a3b00077174c1dcf3fd831bebd78da7587abee5909825820b1c2768b4f0c4a98222ea8165b3fd81deed1fee0ddf1567321c36d8a59c20bd701825820b63ad31ce83c64f72477ba1bdbaccb2f0f7a084f177767ea3fef23b959daef8601825820c7ecc450115bb1fcd03baeef2695f9796df0156a24e73c54da83990e4b19402c00825820e41fb214724ce2b95f66567158f8574b468aa30b196cf5a069fc31ee18811df200825820eeefab68d05d6312a91587496a58ca51dd867f1fb6010f16db5d056e8237962400825820fab86937fd4a120694c7bed9e95cff9a118ab729e7e3f3d4db4eb7be1b460a3601019282583901473624b4c0fe6828b72cd97345320d1ae5d68d4fe92a2cbd96cf7b83ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a23ae362b82583901af43f352330570f5541f55d509cf6aa006e9783b32d27794f3ac1b53ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b00000023668753008258390159b234a5b81b92c67c3dd8c8e734cc86dc27262e087669de1ea43171ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a3b9aca00825839013dc53de0e94cdf65d21770b182af415cf8554a30e7e079c2e9ad4eddff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b00000002204a39f0825839012dddd22fb035183d740e8e1aae71c1624967ecd9c07800c1a83a9a29ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b0000001b646db74282583901ec8872125df29a7740c02a7051fbc4296cca51944d41b1a819732db7ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b00000001852570d782583901be835636a208ec22bf164dbdd4d618b761d37358e8be04b619691032ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a0ee6b28082583901eedca1c715fa475953b027a01fd05419369d3c6dce6f13cc7a780267ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a1dbe22c082583901744602c28e50bff456a82ae3f2016dffc9c6685381311d9e249cc24eff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b000000129095126082583901eb92385a5b600867a57599c39680c2cb43007d2cd969349c8eb18803ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a3b9aca00825839012a2627bad51a09f5b3c1c97945abd03863c98084f8ffadeb878d9dabff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b00000043aa0716408258390125e916df2d055b4b5a4fc1fb5e5f06ae569aaace0ae76fd28b9f2465ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31b000000043245bba0825839018042a91766ab6a926f7eb61b0c4633e49b6eb57ae9816cd03f961d21ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a1dcd650082583901c4b14506f0d41421ad6d7a9b225a18c08cab7f93106892d26aec6481ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a11e1a30082583901f712d1e7550ee536a81f335ecb682477d8b3337c12dd181f87a3fb59ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a21bf369d825839018400acd8c660e25e37d152a1f5c6213139fa473f7e533b62feae5f81ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a1dcd650082583901e4b1fcf8f2e1b353abe4e6ce8fad6040fd3015fdd5fbf49c7a9bee65ff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a05f5e1008258390182aa6f058e0bd9d4387c0f6c110c4aab3ee40a8c5eb75e4b61f72cbdff57a0bbcaaada72b6e3d6d9044c420d1a8dd97794884d39021f1ea31a1dcd6500021a0005cd95031a0044ab60a40081825820241ffd29c5a6477ad721a18975526481c4f0be049a8fe4aac3b5270ce84b494801018182583901e97945b695b2c3a050ea58481ec26021b1e1a1b6ad26ccd2e2473c6bae4aa4f6e3ec89978e226fd44dab52e84705384b40db13af9627bc061b000000012a0ab1b5021a00029469031a0044ab6082a102888458203806766194d98b7add44551ae05d0ae289afd2d24ad5f07a7b357c74005a4bfd584027d9fff7319e0c753ce5e3129d11fda3af4954ddd09186f1ec6a2fc78dea18f69036288983c8be26649b1d14b7fde106ec1a0a13984c0215caaeac2add03d40258207835b5aa8dde8ff1acf95c76062a8c1e7cf3ed0d5edab612d0a627b7959fbab25822a101581e581ce0d2e88fe9acc921b6a2112cdacac682f9796dfc63cee6cc5b994e0c845820228c59561507bcfa74fe598cba2606051710460affeb46b9b8fe52cccd5f4ea05840bd66d25bafe95d81652da718b23e3b6cdc9496eb2176cb3d1a93bba3248f319acde888d0602537ba32c1ca0e7fb59bdd0d34243d5d80ef8eb580d1d5b4b2bf005820947121d1ae2a49d67b1995b006195810c6bc9431cc7c513c573e5f5622cfc46b5822a101581e581ce0d2e88fe9acc97c16c34c2c5d6f42432d3d93ce82e311d2a2e4f98b8458202cc1504e58feb072920b34ae13ed4fe637bccfa5843954911df8273959dfb19e5840fc715894ce8b8fe22d001d5aef54876dfcfc3c0fe69467505eccd256220e8ea90d918e48bd16ea77972ee3eab40d2d4edf0c48393e04f3189050754f6a3a740858205df57bb5b62905e66b8655e7c2bdb7494a900c8b13068d2baf25118c0f6832085822a101581e581ce0d2e88fe9acc91bdc31b72c1ba9b932f9613cdc014a5d205fbc5d3d845820a61fe2310790a6a7af63e59ccd8281e68a9ec22f947ef6e4da65be26f706805b5840517899cb22a051b99dff98ca3d90b8ac374c2da97e7c36e2818c5769d745cd130bd6a44455c15a686d5ba986fc7e6b5334f727e9f83cd080b3a612174e49ad0e58208a4fe2d4e0693b7f758f2faa6c74d80bded18e62572924787f98f9694b8982685822a101581e581ce0d2e88fe9acc906a513472cfe80079ecf2dbaf50a09a0590dea4f8184582027db61206bc0cddaa8212056a8309cf30bfda8d708a3c2e4723a3053ffc88dfc5840278d8468993cc8e055cf518f86c3b4ea8ca3f1085df10c5d0ac844a5b8c2e2aad41506938e545c4f1d2ae1dba6065e38272d3fcd6d1ee3bf1817bad0652d21025820bdb5b547954a8af5df9a9c38eb78b34f8a94355c86925778bb7dad76fc32a5cb5822a101581e581ce0d2e88fe9acc92f4da90b2c76539da339ad0575df0eced864c388258458203f9e179cee15891ec803a5376c027045648e583019e7a27b2aa80b80eaadcb0c5840749ddd93c8247142d092ad7859d6ef408032740ec5b5856687787c04b3820c6b025c7249d1e1ba732fce1794e65e6cd5393067d1b1e8edc8926274f303193d0358207bdd34034bf2babeb038f84632c0bafd5683c72d443aa645c47a5fde647e31325822a101581e581ce0d2e88fe9acc97bce98942c8bd5e370c7b304c1859f3cc9f3bc69b1845820402ebe96158c31abccfaed41f430a4a2699452382b5d37a37c8109c070d2a14e5840154903f2d817c1681f9eb9032617d7f8ad3f5278a1cd59fe9e2960d2651bb90f9c9893f1922b9716b2499c1172da9345ffc86d543ae3de37e8ffaf64389a690058202e8bda7f7b87117dd5763fad087d4121c5022eace06425a291eef90a7639f5005822a101581e581ce0d2e88fe9acc96d0385562c4496150c83b08de620732f7bb516f5a68458204bcb8bde6545670f541555a319d17668c3f1a4c4eda8cd26b25c23ee2463a0c858407080290c0bfc4b9e73c61cde89d963a9965caf67440224622f492abcd234f9af79c58eaa0e8c0e69cb3aeb44c1074bed543ec53b026e9236c50c7301bf49580d5820ebdb707645aeca63ef9ce403cca460b453fc408e35865d4b979196fdf98290b75822a101581e581ce0d2e88fe9acc93ece03772c88331dad1dce579409036b25defd6771a10281845820cae5f2d9032a21b0d872eb9ab8e80df907c85c42611f3599d31eedbadc9c0c4a5840ef518b383daab40ad8310a26c349d368d9f6ae56e1866fdec03f9db903e6dcf169ea7b08dc47776580afbd8836006a71b8712834759bf7291b90167533a6fd0b5820ed6665aba663529088690c264aca85dec22075a2e77ab3080cd13f040015c2835822a101581e581cb1fa7c35461241a8052e481e0e80d8a4f95839c76c243ff40daa3135a0

@hildjj this one looks critical

@hildjj
Copy link
Owner

hildjj commented Aug 5, 2020

I'll take a look. I'm going to make digging into tag 24 possible, but not the default. Setting max_depth correctly fixes a bunch of problems, so I'm looking into how to set it automatically by decoding twice -- that's a little difficult to do in the streaming approach, but I'll figure something out.

@hildjj
Copy link
Owner

hildjj commented Aug 5, 2020

Oh, also max_depth interferes with the same-named option on Decoder, so I'm going to rename it to dash_indent.

@hildjj
Copy link
Owner

hildjj commented Aug 5, 2020

For longer inputs, you also need to set the highwaterMark until I fix #43 in some better way.

@ashisherc
Copy link
Author

Oh, also max_depth interferes with the same-named option on Decoder, so I'm going to rename it to dash_indent.

that was the issue proly when I tried to manually set max_depth to a larger number but no luck.

Also I don't seem to be able to set highwaterMark for cbor.comment

@hildjj
Copy link
Owner

hildjj commented Dec 31, 2020

I wanted to fix this more completely before doing a release, but I need to get a bugfix out, and can't be bothered to do branching correctly, apparently. Apologies to myself in the future as I trigger 5.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants