https://github.com/j-hc/pbdecoder-rs
decode raw protobuf binaries into json without having the proto files
https://github.com/j-hc/pbdecoder-rs
Last synced: 3 months ago
JSON representation
decode raw protobuf binaries into json without having the proto files
- Host: GitHub
- URL: https://github.com/j-hc/pbdecoder-rs
- Owner: j-hc
- Created: 2022-09-08T11:06:46.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-09-11T10:04:45.000Z (over 2 years ago)
- Last Synced: 2025-01-13T13:52:27.949Z (5 months ago)
- Language: Rust
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pbdecoder
Decode raw protobuf binaries into JSON (or into any other schema) without having the proto files
```toml
# Cargo.tomlpbdecoder = { git = "https://github.com/j-hc/pbdecoder-rs.git" }
``````rust
use pbdecoder::decode_proto;let f = std::fs::read("protobuf-binary").unwrap();
let (parts, remaining_bytes) = decode_proto(&f);let s = serde_json::to_string(&parts).unwrap();
std::fs::write("resp.json", s).unwrap();
```