Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add read functions for varint BE and LE #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

antonilol
Copy link

(for Bitcoin's VarInt and VarUInt)

i use this library for parsing the entire blockchain (blk files) and this functionality would be great addition to the other functions

great info site: https://learnmeabitcoin.com/technical/varint

basically the first byte tells how much bytes long the numbers is or is the number himself

(for Bitcoin's VarInt and VarUInt)
@normanr
Copy link

normanr commented Oct 4, 2022

Note that protocol buffer varints are different: They store 7 bits-per-byte, and use the most-significant-bit as a continuation bit. The encoding is called VLQ, (compared to LEB128 which is the little-endian version). Bitcoin and utf8 use a "PrefixVarint".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants