Variable Byte Encoding is a method for storing integers in a compressed format in computer memory or disk. This tool converts a number to variable byte encoding. I couldn't find a simple online tool that could convert a number using variable byte encoding for my IR class, so I made one.
Ending bit: Which bit value to use as the ending bit. This is the bit that indicates
whether the current byte is the last byte.
Endianness: The order in which the bytes are stored in RAM or disk. For example,
writing down the number 1234 left to right on a piece of paper is big-endian, while writing
it as 4321 is little-endian. Either way will represent 1234, but the order is different.
Similarly, a computer may write the "digit" (here a byte) 1 or 4 first in memory.
Big-endian is more common.
More about endianness
Typically we store numerical values with fixed sized lengths of bytes which helps us know where each value starts and ends in a chunk of bits. However, this can be inefficient when we have a lot of small numbers as rest of the bits are filled with zeros. For example the value 8 in a standard 32 bit int format would be stored as:
00000000 00000000 00000000 00001000
We could define integer to be use fewer bits but then we would not be able to store large numbers. Instead, we can use Variable Byte Encoding to store integers in a compact way while retaining the ability to store large numbers. The idea is to use the most significant bit of each byte to indicate whether there are more bytes to come. If the most significant bit is not equal to the ending-bit, then there are more bytes to come. If the most significant bit is ending-bit, then this is the last byte. Either 0 or 1 can be used as the ending bit as this is arbitrary. The remaining 7 bits are used to store the integer value. The number 8 would be stored as:
00001000 (Assuming the ending bit is 0) OR 10001000 (Assuming the ending bit is 1)
For larger numbers, for example 1234:
10001001 01010010 (Assuming the ending bit is 0) OR 00001001 11010010 (Assuming the ending bit is 1)
Both examples above are in big-endian format.