Examples
A small field value
Input
1Expected answer
Hexadecimal bytes| Offset | Hex bytes | ASCII |
|---|---|---|
| 00000000 | 01 | . |
01
A 7-bit boundary
Input
127Expected answer
UTF-8 text · exact bytes
The first two-byte value
Input
128Expected answer
Hexadecimal bytes| Offset | Hex bytes | ASCII |
|---|---|---|
| 00000000 | 80 01 | .. |
80 01
The official Protobuf example
Input
150Expected answer
Hexadecimal bytes| Offset | Hex bytes | ASCII |
|---|---|---|
| 00000000 | 96 01 | .. |
96 01
A counter of 300
Input
300Expected answer
Hexadecimal bytes| Offset | Hex bytes | ASCII |
|---|---|---|
| 00000000 | ac 02 | .. |
ac 02
A three-byte boundary
Input
16384Expected answer
Hexadecimal bytes| Offset | Hex bytes | ASCII |
|---|---|---|
| 00000000 | 80 80 01 | ... |
80 80 01
Format reference: VarInt Encode background and specification