Integers are encoded as ordinary binary big-endian [encoding/String], that has prepended byte indicating is it positive or negative integer. Negative integers store positive absolute value, minus one. After decoding, their value is subtracted from -1. Negative value encoded as 0x02 means: -1 - 0x02 => -3. Shortest possible form *must* be used, that means no leading zero byte. 0 and -1 values are empty strings, so even they won't have leading zero. Example representations: 0 | 2B 80 1 | 2B 81 01 10 | 2B 81 0A 100 | 2B 01 64 65536 | 2B 83 010000 1000000000000 | 2B 85 E8D4A51000 18446744073709551615 | 2B 88 FFFFFFFFFFFFFFFF 18446744073709551616 | 2B 89 010000000000000000 -18446744073709551616 | 2D 88 FFFFFFFFFFFFFFFF -18446744073709551617 | 2D 89 010000000000000000 -1 | 2D 80 -10 | 2D 81 09 -100 | 2D 81 63 -65536 | 2D 82 FFFF