At some stage we named the compact encoding `VarInt` (which makes sense because the compact size encoding is a variable length integer encoding). However it turns out the term "varint" is used in Core for a different encoding so this may lead to confusion. While we fix this naming thing observe also that the `VarInt` type is unnecessarily complicated, all we need to be able to do is encode and decode integers in compact form as specified by Core. We can do this simply by extending our `WriteExt` and `ReadExt` traits. Add `emit_compact_size` and `read_compact_size` to emit and read compact endcodings respectively. Includes addition of `internals::compact_size::encoded_size_const`. Patch originally written by Steven, Tobin cherry-picked and did a bunch of impovements after the varint vs compact_size thing (#1016). ref: https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer Co-developed-by: Tobin C. Harding <me@tobin.cc> |
||
---|---|---|
.. | ||
contrib | ||
src | ||
CHANGELOG.md | ||
Cargo.toml | ||
README.md | ||
build.rs |
README.md
Rust Bitcoin Internals
This crate is only meant to be used internally by crates in the rust-bitcoin ecosystem.
This crate will never be stabilized, depend on it at your own risk.