Ninjastic
Home
Search
Users
Boards
Addresses
Ctrl + K
Toggle theme
Open menu
Post
Edited versions
Quotes to this post
Post
2204810
Topic
210188
Board
Development & Technical Discussion
Re: Blockchain parsing
by
Zeilap
on
19/05/2013, 23:08:56 UTC
Quote from: kerzane on May 19, 2013, 02:40:00 PM
Anyone know the solution to this problem?
https://en.bitcoin.it/wiki/Protocol_specification#Variable_length_integer
Read the first byte as uint8 and check its value, you have 4 choices,
<0xFD: use the value as it is
0xFD: read 2 more bytes as uint16
0xFE: read 4 more bytes as uint32
0xFF: read 8 more bytes as uint64