Leading Zeroes

GodotEngine

If you've ever used Wireshark or other network packet inspection tools, you'll be familiar with seeing raw byte data presented as a string of pairs of hexadecimal digits.

If you haven't, then perhaps you'll know what ASCII or Unicode is. Because of how text is stored on computers, each character is assigned a number. Sometimes it's valuable to display those numbers, and thanks to the underlying binary representation, this can be done compactly by using the hexadecimal representation of the number. This is much easier to understand with a picture:

Source: https://en.wikipedia.org/wiki/ASCII#Character_set

Converting hex values to their character equivalents is trivial when you have the appropriate lookup table, like the one above. My question is, would it be an interesting puzzle to build that lookup table yourself based on some encoded input?

Read more...