Correct Compact Size Uint ranges

This commit is contained in:
Andrew Chow 2017-05-21 23:22:55 -04:00
parent 4c9a38f8e3
commit 2952c309cb

View file

@ -407,11 +407,11 @@ byte is prefixed to the number to indicate its length---but otherwise
the numbers look like regular unsigned integers in little-endian order. the numbers look like regular unsigned integers in little-endian order.
| Value | Bytes Used | Format | Value | Bytes Used | Format
|-----------------------|------------|----------------------------------------- |-----------------------------------------|------------|-----------------------------------------
| <= 252 | 1 | uint8_t | >= 0 && <= 252 | 1 | uint8_t
| <= 0xffff | 3 | 0xfd followed by the number as uint16_t | >= 253 && <= 0xffff | 3 | 0xfd followed by the number as uint16_t
| <= 0xffffffff | 5 | 0xfe followed by the number as uint32_t | >= 0x10000 && <= 0xffffffff | 5 | 0xfe followed by the number as uint32_t
| <= 0xffffffffffffffff | 9 | 0xff followed by the number as uint64_t | >= 0x100000000 && <= 0xffffffffffffffff | 9 | 0xff followed by the number as uint64_t
For example, the number 515 is encoded as 0xfd0302. For example, the number 515 is encoded as 0xfd0302.