The function emojid()
deterministically converts hexadecimal strings (like sha1sum, md5sum, uuid4, uuid5) into emoji containing strings, remojid()
converts back.
Implementations in Javascript and Python are provided.
Β―\_(γ)_/Β―
The code will in each step
- take the value of 2 hex chars
- add a "magic" offset (U+1F400) to it
- convert it to unicode
There is a bit of tolerance built in: Non hex chars will be ignored and simply be added to the result. But I wouldn't push it too hard.
md5
emojid(42eab827e162899feb01af513c39be46) =>ππͺπΈπ§π‘π’πππ«ππ―ππΌπΉπΎπ
shasum
emojid(d50aabf4b2f62569b976a4b16d6dfc86750499a7) => πππ«π΄π²πΆπ₯π©πΉπΆπ€π±πππΌππ΅πππ§
git short hash
emojid(21132ad) => π‘ππͺd
uuid4
emojid(f6e3299a-525a-4c5f-bebc-ef014b608a66) => πΆπ£π©π-ππ-ππ-πΎπΌ-π―πππ ππ¦
reverse
remojid(π‘ππͺd) => 21132ad