https://github.com/tom-code/pbtool
https://github.com/tom-code/pbtool
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tom-code/pbtool
- Owner: tom-code
- Created: 2023-12-31T11:41:08.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-01T16:01:36.000Z (about 2 years ago)
- Last Synced: 2024-01-02T12:34:47.896Z (about 2 years ago)
- Language: Rust
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Utility to encode/decode protobuf data into human readable format (json).

Example use:
```
get help:
pbtool help
pbtool encode --help
pbtool decode --help
```
Encode using protobuf defintion in test/a.proto type M1. Read input data from test/a.json.
Read additional protobuf dependencies from directory test.
Output store into file a.bin
```
pbtool encode test/a.proto .M1 test/a.json -o a.bin -i test
```
Encode using protobuf defintion in test/a.proto type M1. Read input data from test/a.json.
Read additional protobuf dependencies from directory test.
Output store into file a.hex in hexadecimal format
```
pbtool encode test/a.proto .M1 test/a.json -o a.hex -i test -f hex
```
Decode using protobuf defintion in test/a.proto type M1. Read input data from file a.bin.
Read additional protobuf dependencies from directory test.
```
pbtool decode test/a.proto .M1 @a.bin -i test
```
Decode using protobuf defintion in test/a.proto type M1. Read input data from file a.hex in hexadecimal format.
Read additional protobuf dependencies from directory test.
Store output json in xx.json.
```
pbtool decode test/a.proto .M1 @a.hex -i test -f hex -o xx.json
```
Decode using protobuf defintion in test/a.proto type M1. Use input data from cli argument (CAoSA2FiYxoDCM0C) in base64 format
Read additional protobuf dependencies from directory test.
```
pbtool decode test/a.proto .M1 CAoSA2FiYxoDCM0C -i test -f base64
```