What’s so special about 0x7f?

This is a form of bit-packing where the most significant bit of each byte is used to determine if another byte should be read. Essentially, this allows you to encode values in a fewer amount of bytes than they would normally require. However, there is the caveat that, if the number is large, then more than the normal amount of bytes will be required. Therefore, this is successful when working with small values.

Getting to your question, 0x7F is 0111_1111 in binary. You can see that the most significant bit is used as the flag bit.

Leave a Comment