A few weird ways of displaying git hashes

Monday, August 7, 2023

I was reading "Real-World Cryptography" and ran across an thought-provoking statement. While talking about why hashes are often represented in hexademical, the author states (emphasis mine):

There are other ways to encode binary data for human consumption, but the two most widely used encodings are hexademical and base64. The larger the base, the less space it takes to display a binary string, but at some point, we run out of human-readable characters.

Well... at what point do we run out of human-readable characters, and what if we used things beyond ASCII?

My first idea was to represent hashes as emoji to get a larger space of human-readable and easily distinguishable glyphs. After that I came up with a few I wanted to try out:

  • emoji
  • words, ala passphrases
  • colors

Here are the three most recent commits in one of my repositories, represented in these different ways.

Hexadecimal:

  • f7f05111ddb22b58fdad8bee63a3cd2bcea43398
  • afed35d15a2d8c59e3a9f695732553999593c51d
  • 0dd0c241906eb6720c0e4fe1e06a90f777453cc5

Emoji:

  • ๐Ÿ’ฎ๐Ÿ‘ญ๐Ÿฝโš™๏ธ๐Ÿ‡น๐Ÿ‡ฒ๐Ÿ‡น๐Ÿ‡ด๐ŸŸซ๐Ÿšฌ๐Ÿง” ๐Ÿผโ€โ™€๏ธ๐Ÿง๐Ÿฝโ€โ™‚๐Ÿ‘ฎ๐Ÿพ๐Ÿง‘ ๐Ÿฝโ€โคโ€๐Ÿ’‹๐Ÿพ๐Ÿง๐Ÿผ๐Ÿ‘ฉ ๐Ÿฝโ€โคโ€๐Ÿ’‹๐Ÿฝ๐Ÿฅ‰
  • ๐Ÿง‘๐Ÿผโ€๐ŸŽจ๐Ÿšง๐ŸŒก๐Ÿ‘ฉ๐Ÿผ๐Ÿ›๐Ÿงœ๐Ÿป๐Ÿ˜ฉ๐Ÿšป๐Ÿ’—๐Ÿ’Š๐Ÿ—ณ๏ธ๐Ÿคน๐Ÿฝโ€โ™€๐Ÿ‘ณ๐Ÿพ๐Ÿฅˆ
  • ๐Ÿ‘ฎ๐Ÿป๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿฆฑ๐Ÿ‡ต๐Ÿ‡ฑ๐Ÿคฝ๐Ÿฟโ€โ™‚๐Ÿž๐Ÿ‘ฉ ๐Ÿปโ€โคโ€๐Ÿ‘ฉ๐Ÿพ๐Ÿง‘โ€๐Ÿ’ป๐Ÿซฑ๐Ÿฟโ€๐Ÿซฒ๐Ÿพ๐Ÿฉ๐Ÿง‘๐Ÿฟ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿ’ผ๐Ÿง‘โ€๐Ÿณโ›ช

Words (selected from the EFF word list):

  • unburned path scrambled demotion awning outpour echo museum iciness payee perish vending account
  • ripple wrongly untaken undermine serve handgrip festivity blend bankbook capitol egging outback absolve
  • naturist tartly engraver haphazard renovate douche guidable tidiness nuttiness catlike unearth pox abdomen

Colors:

Personally, I think I like the color one best from a pure visual perspective, but it comes with a lot of accessibility issues. The color space would probably need tuning to make it easier to visually distinguish between hashes, too. I think it's also probably best combined with the hex representation of the hash itself, so we add another layer on top of the existing representations to make things easier to distinguish instead of relying on just one new representation.

At any rate, this was a fun little experiment! This isn't something I would use in a real application, but different ways of representing bits of information are fun to explore. If you've done anything similar I'd love to hear about it.

The code for this post is available in my sketches repo.


If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts and support my work, subscribe to the newsletter. There is also an RSS feed.

Want to become a better programmer? Join the Recurse Center!
Want to hire great programmers? Hire via Recurse Center!