Expand description
Bitsplain is a library that helps people understand Bitcoin-related binary data. When provided with some data — be it a binary file, hex-encoded string or any other commonly used encoding scheme — Bitsplain first tries to identify what the data represent and if it succeeds it offers an explanation of the data through “annotations”. These annotations consist of description, data type, rendered value, position in the binary input etc.
The library does not interpret the annotations, however crate bitsplain-bin
offers two user interfaces, a CLI and GTK.
Use it
Calling bitsplain::decode::decode_input(input)
will return a vector of candidates
.
Each of the candidates contains reference to decoder
which successfully
parsed the data, the tree
of annotations and view over original binary data.
How it works?
Bitsplain uses nom
to implement parsers of all the supported data formats.
Using custom parser implementation it can track every value that the parser
returns and its position within the data. All this information is assembled
in a tree of Values
, which is then returned for interpretation. Writers of data parsers
can use a convenient DSL
.
Re-exports
Modules
Value
is intermediate type between domain-specific types and final presentation.