CBOR2COMMENT(1)
okay so bestie, pull up a chair π«Ά this is cbor2comment(1), the manual page for the lil tool that takes CBOR wire protocol and gives you back a commented version of it. it's giving β¨annotated hexβ¨ and we're gonna go through every single line together, no cap.
π NAME π
cbor2comment β convert CBOR wire protocol to commented version π
πΈ SYNOPSIS πΈ
cbor2comment test.cbor > test.txt
that's it. that's the whole vibe. feed it a file, redirect the glow-up into a text file. periodt. π
π¦ DESCRIPTION π¦
so like, cbor2comment creates a commented version of an input bytestream. not a decoder, not a pretty-printer that hides stuff β a commentary track for your bytes. π¬
for example, if the input contained the two bytes (in hex) 61 61, the output would be:
61 -- String, length: 1
61 -- "a"
0x6161
see how it eats?? π every byte gets its own little annotation, and then the summary hex line sits right there at the bottom like the credits. 61 says "String, length: 1", the nested 61 says "a", and 0x6161 is the whole thing in one glance. iconic. π
β¨ OPTIONS β¨
-β read from stdin instead of a file. this is the default, so if you just pipe stuff in, you're already doing it right. π«Ά-t NUM,--tabsize NUMβ the number of 2-space tab indents to move the--to the right. so like, it's how far over your comments hang. lowkey a vibe knob. eventually, this will be replaced with an algorithm that takes two passes over the input. π-x [string]β read the input from the hex-encoded string on the command line. no file needed, just yeet the hex straight at it. π₯-V,--versionβ print thenode-cborversion and exit. short and sweet. π-h,--helpβ print some help text and exit. your friendly lil escape hatch. π
π TODO π
aka the "not me writing a list of my own homework" section, and honestly? relatable.
cbor2commentis not built for execution speed or reuse. π it does the thing! it's just not racing anybody.- Make 2 passes over the input. (this is the same two-pass dream the
-tflag is waiting on, iykyk. π§) - Move the summary hex output to the beginning. right now it's at the end, and it's gonna get relocated to the front. glow-up pending. β
π SEE ALSO π
node-cborhttps://github.com/hildjj/node-cbor β the whole reason any of this exists, go give it a follow bestie.RFC 8949https://www.rfc-editor.org/rfc/rfc8949.html β the actual spec, the source material, the canon text. read it when you're feeling academic. π
and that's the whole page!! π this one's from November 2022, living in section 1 as CBOR2COMMENT(1), and brought to you by the node-cbor crew (yes, the same version that -V will happily print for you π«Ά). go comment some bytes, you're gonna slay. π
β¨
π¦ where this page comes from
- ubuntu noble: node-cbor 8.1.0+dfsg+~cs5.2.1-3 Β· MIT
- ubuntu resolute: node-cbor 8.1.0+dfsg+~cs5.2.1-3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms