An open API service indexing awesome lists of open source software.

https://github.com/vi/cborsplit

Split CBOR data into text/bytestring stream and misc stream
https://github.com/vi/cborsplit

bytestring cbor extract library rfc7049 split string utility

Last synced: 3 months ago
JSON representation

Split CBOR data into text/bytestring stream and misc stream

Awesome Lists containing this project

README

          

# cborsplit

Splits [CBOR][1] data into two streams:

2\. Only text and bytestring contents.
1\. Everything else.

```
┌──────┐ *──────────────* ┌──────────────┐
│ CBOR │ ──> │ cborsplit -s │ ──> │ text │
└──────┘ *──────────────* └──────────────┘
│ │
│ │
∨ ∨
┌──────────────┐ *──────────────* ┌──────┐
│ misc │ ──> │ cborsplit -m │ ──> │ CBOR │
└──────────────┘ *──────────────* └──────┘
```

```
$ ./cborsplit --help
Usage:
cborsplit {-s|--split} in out1 out2
cborsplit {-m|--merge} in1 in2 out
'-' instead of in/out means stdin/stdout
'-' instead of out1/out2/in1/in2 means fd 3/fd 4/fd 3/fd 4

$ ./cborsplit --split something.cbor misc.dat text.dat
$ ./cborsplit --merge misc.dat text.dat something2.cbor
$ cmp something.cbor something2.cbor
```

Why? Maybe to compress something better or to repace some bytes inside the text.

Hint: JSON data can be round-tripped though CBOR.

License is MIT + Apache 2.

[1]:https://github.com/cbor/spec-with-errata-fixed/blob/master/rfc7049-errata-corrected.txt