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!