1.0.0 • Published 6 years ago

hexoji v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

hexoji

hexoji is a module for deterministically encoding and decoding hexadecimal strings as emoji using characters from the Emoticons Unicode block. Encodings can be performed using one of five character sets.

Build status

available character sets

default: Set 0

Set 0Set 1Set 2Set 3Set 4
0😀😐😠😰🙀
1😁😑😡😱🙁
2😂😒😢😲🙂
3😃😓😣😳🙃
4😄😔😤😴🙄
5😅😕😥😵🙅
6😆😖😦😶🙆
7😇😗😧😷🙇
8😈😘😨😸🙈
9😉😙😩😹🙉
a😊😚😪😺🙊
b😋😛😫😻🙋
c😌😜😬😼🙌
d😍😝😭😽🙍
e😎😞😮😾🙎
f😏😟😯😿🙏

example

var sha1 = require('simple-sha1')
var encode = require('hexoji/encode')
var decode = require('hexoji/decode')
var set = undefined // or a number [0-4]

sha1('hexoji', function (hash) {
  console.log(hash)
  > '19d52be9ca083fa5903c8ac807e693c2ed037abe'
  console.log(encode(hash, set))
  > '😁😉😍😅😂😋😎😉😌😊😀😈😃😏😊😅😉😀😃😌😈😊😌😈😀😇😎😆😉😃😌😂😎😍😀😃😇😊😋😎'
  console.log(decode(encode(hash, set)))
  > '19d52be9ca083fa5903c8ac807e693c2ed037abe'
})

install

$ npm install hexoji

licence

MIT