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
- Host: GitHub
- URL: https://github.com/vi/cborsplit
- Owner: vi
- Created: 2017-07-18T01:57:40.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-18T02:04:09.000Z (almost 9 years ago)
- Last Synced: 2025-02-28T06:04:34.366Z (over 1 year ago)
- Topics: bytestring, cbor, extract, library, rfc7049, split, string, utility
- Language: C
- Size: 9.77 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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