1
0
Fork 0
mirror of https://github.com/emojisum/emojisum.git synced 2024-11-15 20:28:37 +00:00
🙏 📎 Emoji that checksum! 🎉 💩
Find a file
Vincent Batts cc9cb5d099
emoji: fix merged unicode
for several of the emoji "words", they are a union of unicode points.
Like flags are the two letters together. Female Detective is a number of
connected symbols. This representation needs to be alltogether.

With this update the unicode points are joined, and require spliting on
the "U+". To help with this and be useful as a library there is a
function `emoji.CodepointToUnicode(string) string` to do this now.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-10-16 14:38:00 -04:00
emoji emoji: fix merged unicode 2018-10-16 14:38:00 -04:00
.gitignore Initial commit 2016-12-02 11:34:29 -05:00
.travis.yml travis: updates 2018-10-15 13:20:30 -04:00
LICENSE Initial commit 2016-12-02 11:34:29 -05:00
main.go main: shorten the parse flag 2018-01-27 06:15:30 -05:00
README.md emoji: fix merged unicode 2018-10-16 14:38:00 -04:00

emojisum

Build Status

🙏 📎 Emoji that checksum! 🎉 💩

A curated list of 256 emojis that are not entirely similar. Using http://www.webpagefx.com/tools/emoji-cheat-sheet/ and http://www.unicode.org/emoji/charts/full-emoji-list.html to compare them. With 256 as that is 8bit/1byte, and the hexadecimal output that is 2 hex characters.

So 2 hex positions are 1 emoji! Would you rather compare 60 hexadecimal characters or only 30 emoji?! 😺

Specification

For information on the draft for broader practice, see the draft. Perma-URL:

Tool

build

go get github.com/emojisum/emojisum

usage

This uses github.com/kyokomi/emoji to print to the console, but also gives the string ouptut for easy pasting to github/markdown.

$> emojisum main.go 
SHA1(main.go)=  14b09535217ca8f5f47f4665e2266e686f0728b4
SHA1(main.go)=  :bird::red_car::on::crystal_ball::calendar::lemon::pray::warning::violin::lollipop::facepunch::hearts::tm::children_crossing::hourglass::heavy_plus_sign::house::ant::clap::rocket:
SHA1(main.go)=  🐦 🚗 🔛 🔮 📆 🍋 🙏 ⚠️🎻 🍭 👊 ♥️™️🚸 ⌛️➕ 🏠 🐜 👏 🚀 

Like so!

SHA1(main.go)= 🐦🚗🔛🔮📆🍋🙏⚠️🎻🍭👊♥️™️🚸🏠🐜👏🚀

pass in the checksums

Rather than relying on this simple tool to do the checksum itself, you will likely want to rely on OpenSSL or coreutils for checksumming. emojisum can just take those formats on stdin:

$> sha1sum main.go | emojisum -pg
7656835947b4c6da272023c56b6f2529511bf88b  main.go
:jp::gb::metal::goat::family::rocket::smiley_cat::swimmer::chocolate_bar::cactus::candy::smile::honeybee::house::cherries::cloud::fries::bow::wavy_dash::musical_score:  main.go
🇯🇵 🇬🇧 🤘 🐐 👪 🚀 😺 🏊 🍫 🌵 🍬 😄 🐝 🏠 🍒 ☁️🍟 🙇 〰️ 🎼   main.go

Like so:

🇯🇵 🇬🇧 🤘 🐐 👪 🚀 😺 🏊 🍫 🌵 🍬 😄 🐝 🏠 🍒 ☁️🍟 🙇 〰️ 🎼 main.go

$> openssl sha1 main.go |emojisum -pb
SHA1(main.go)= 7656835947b4c6da272023c56b6f2529511bf88b
SHA1(main.go)= :jp::gb::metal::goat::family::rocket::smiley_cat::swimmer::chocolate_bar::cactus::candy::smile::honeybee::house::cherries::cloud::fries::bow::wavy_dash::musical_score:
SHA1(main.go)= 🇯🇵 🇬🇧 🤘 🐐 👪 🚀 😺 🏊 🍫 🌵 🍬 😄 🐝 🏠 🍒 ☁️🍟 🙇 〰️ 🎼 

And like so:

SHA1(main.go)= 🇯🇵 🇬🇧 🤘 🐐 👪 🚀 😺 🏊 🍫 🌵 🍬 😄 🐝 🏠 🍒 ☁️🍟 🙇 〰️ 🎼

Library

Use the golang library to access the mapped emoji words:

package main

import (
  "fmt"

  "github.com/emojisum/emojisum/emoji"
)

func main() {
  for i := 0; i < 255; i++ {
    fmt.Printf("%d :\n", i)
    for _, word := range emoji.Map(byte(i)) {
      fmt.Printf("  - %s\n", emoji.CodepointToUnicode(word))
    }
  }
}