CFB code generator
Project description
CFB Encoding
CFB (Canonical FlatBuffers) is a restricted variant of FlatBuffers for producing unequivocal transfer syntax.
Usage
Install the code geneartor as commane line utility:
pip install -U cfbc
First generate bfbs file from fbs:
flatc -b --schema example.fbs
Then generate rust files from bfbs:
cfbc example.bfbs
Use Verifier with flatbuffers rust
- Add the generated
<name>_generated_verifier.rs
to the project in the same directory with the file<name>_generated.rs
generated byflatc -r
. - Add crate
flatbuffers-verifier
as a dependency in Cargo.toml. - Use the same version of
flatbuffers
as inflatbuffers-verifier
.
flatbuffers-verifier = { git = "https://github.com/nervosnetwork/cfb" }
flatbuffers = { git = "https://github.com/google/flatbuffers", rev = "4f10da8d99c1a7bc8c9c7d06d2092a689f171d29" }
The crate flatbuffers-verifier
defines a function get_root
, which is intended to replace the
function with the same name in flatbuffers
. This function will verify the
buffer, and returns a Result
to indicate whether the buffer is valid.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cfbc-0.1.9.tar.gz
(14.2 kB
view details)
Built Distribution
cfbc-0.1.9-py3-none-any.whl
(26.1 kB
view details)
File details
Details for the file cfbc-0.1.9.tar.gz
.
File metadata
- Download URL: cfbc-0.1.9.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48395019b28f1d03cdbe0fde42c388a473fa0cba03a0342c9f26db8903bbe8ae |
|
MD5 | bc6212f4495ceda5df1eeb7b8aac063a |
|
BLAKE2b-256 | ab24bf450c6b97ef078acdb8c4eee5aa89c73a9759721f157cc0d46acd4cfc19 |
File details
Details for the file cfbc-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: cfbc-0.1.9-py3-none-any.whl
- Upload date:
- Size: 26.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fe3cb6ca728650032df85c4c3fe8a6785f553ea08d94848c4dbdd2359ed5579 |
|
MD5 | e04376c7932bad948f8c8565d90de259 |
|
BLAKE2b-256 | 032739375aa806b92715a904ac7bf257a4635d6efe32f319c4a2eb45ece61d31 |