rust-bitcoin-unsafe-fast/internals
Steven Roose 18d8b0e469
Replace VarInt type with ReadExt and WriteExt functions
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>
2024-09-25 06:56:09 +10:00
..
contrib CI: Remove shebang from non-executable scripts 2024-05-31 10:10:00 +10:00
src Replace VarInt type with ReadExt and WriteExt functions 2024-09-25 06:56:09 +10:00
CHANGELOG.md Bump version of internals to 0.4.0 2024-09-18 12:22:59 +10:00
Cargo.toml Bump version of internals to 0.4.0 2024-09-18 12:22:59 +10:00
README.md chore: format and standardize all markdowns files 2024-04-27 06:29:23 -03:00
build.rs 2024-08-25 automated rustfmt nightly 2024-08-25 01:14:09 +00:00

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.