2018-10-13 14:04:19 +00:00
# Emojisum
2017-02-10 15:48:38 +00:00
[![Build Status ](https://travis-ci.org/emojisum/emojisum.svg?branch=master )](https://travis-ci.org/emojisum/emojisum)
2016-12-02 16:32:31 +00:00
:pray: :paperclip: Emoji that checksum! :tada: :poop:
2017-02-10 15:43:41 +00:00
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.
2016-12-02 16:32:31 +00:00
2017-02-10 15:43:41 +00:00
So 2 hex positions are 1 emoji!
Would you rather compare 60 hexadecimal characters or only 30 emoji?! :smiley_cat:
2016-12-02 16:32:31 +00:00
2017-11-17 04:16:30 +00:00
## Specification
2016-12-13 19:02:39 +00:00
For information on the draft for broader practice, see [the draft ](./emoji/README.md ).
2017-02-07 14:44:41 +00:00
Perma-URL:
2019-11-02 12:44:48 +00:00
- [Draft ](https://github.com/emojisum/emojisum/blob/master/emoji/README.md )
- [JSON doc ](https://raw.githubusercontent.com/emojisum/emojisum/master/emoji/emojimap.json )
2016-12-13 19:02:39 +00:00
2017-11-17 04:16:30 +00:00
## Tool
### build
2016-12-02 16:32:31 +00:00
```bash
2017-02-10 15:48:38 +00:00
go get github.com/emojisum/emojisum
2016-12-02 16:32:31 +00:00
```
2017-11-17 04:16:30 +00:00
### usage
2016-12-02 16:32:31 +00:00
This uses [`github.com/kyokomi/emoji` ](https://github.com/kyokomi/emoji ) to print to the console, but also gives the string ouptut for easy pasting to github/markdown.
```bash
$> 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)= :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:
### 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:
```bash
2018-01-27 11:13:56 +00:00
$> sha1sum main.go | emojisum -pg
2016-12-02 16:32:31 +00:00
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
```bash
2018-01-27 11:13:56 +00:00
$> openssl sha1 main.go |emojisum -pb
2016-12-02 16:32:31 +00:00
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)= 🇯🇵 🇬🇧 🤘 🐐 👪 🚀 😺 🏊 🍫 🌵 🍬 😄 🐝 🏠 🍒 ☁️🍟 🙇 〰️ 🎼
2018-10-16 18:32:46 +00:00
## Library
Use the golang library to access the mapped emoji words:
```golang
package main
import (
"fmt"
"github.com/emojisum/emojisum/emoji"
)
func main() {
for i := 0; i < 255 ; i + + {
2018-10-16 19:27:44 +00:00
fmt.Printf("%d (%2.2x):\n", i, i)
2018-10-16 18:32:46 +00:00
for _, word := range emoji.Map(byte(i)) {
fmt.Printf(" - %s\n", emoji.CodepointToUnicode(word))
}
}
}
```
2018-10-13 14:04:19 +00:00
## Contributed Implementations
### Rust
In `./contrib/emojisum-rs/` you'll find a rust library for emojisum.
#### Build
```shell
cd ./contrib/emojisum-rs/
cargo build
```
#### Test
```shell
cargo test
```