Skip to content

Instantly share code, notes, and snippets.

@ChrisCates
Created August 13, 2017 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisCates/b4c60be6dff2b4c1ee09e797d0a8d1d6 to your computer and use it in GitHub Desktop.
Save ChrisCates/b4c60be6dff2b4c1ee09e797d0a8d1d6 to your computer and use it in GitHub Desktop.
const crypto = require('crypto');
let emoji_list = [
"๐Ÿ˜€", "๐Ÿ˜ƒ", "๐Ÿ˜„", "๐Ÿ˜", "๐Ÿ˜†", "๐Ÿ˜…", "๐Ÿ˜‚", "๐Ÿคฃ", "๐Ÿ˜Š", "๐Ÿ˜‡", "๐Ÿ™‚", "๐Ÿ™ƒ", "๐Ÿ˜‰", "๐Ÿ˜Œ", "๐Ÿ˜", "๐Ÿ˜˜", "๐Ÿ˜—", "๐Ÿ˜š", "๐Ÿ˜‹",
"๐Ÿ˜œ", "๐Ÿ˜", "๐Ÿ˜›", "๐Ÿค‘", "๐Ÿค—", "๐Ÿค“", "๐Ÿ˜Ž", "๐Ÿคก", "๐Ÿค ", "๐Ÿ˜", "๐Ÿ˜’", "๐Ÿ˜ž", "๐Ÿ˜”", "๐Ÿ˜Ÿ", "๐Ÿ˜•", "๐Ÿ™", "โ˜น๏ธ", "๐Ÿ˜ฃ", "๐Ÿ˜–", "๐Ÿ˜ซ", "๐Ÿ˜ฉ",
"๐Ÿ˜ค", "๐Ÿ˜ ", "๐Ÿ˜ก", "๐Ÿ˜ถ", "๐Ÿ˜", "๐Ÿ˜‘", "๐Ÿ˜ฏ", "๐Ÿ˜ฆ", "๐Ÿ˜ง", "๐Ÿ˜ฎ", "๐Ÿ˜ฒ", "๐Ÿ˜ต", "๐Ÿ˜ณ", "๐Ÿ˜ฑ", "๐Ÿ˜จ", "๐Ÿ˜ฐ", "๐Ÿ˜ข", "๐Ÿ˜ฅ", "๐Ÿคค", "๐Ÿ˜ญ", "๐Ÿ˜“",
"๐Ÿ˜ช", "๐Ÿ˜ด", "๐Ÿ™„", "๐Ÿค”", "๐Ÿคฅ", "๐Ÿ˜ฌ", "๐Ÿค", "๐Ÿคข", "๐Ÿคง", "๐Ÿ˜ท", "๐Ÿค’", "๐Ÿค•", "๐Ÿ˜ˆ", "๐Ÿ‘ฟ", "๐Ÿ‘น", "๐Ÿ‘บ", "๐Ÿ’ฉ", "๐Ÿ‘ป", "๐Ÿ’€", "โ˜ ๏ธ", "๐Ÿ‘ฝ",
"๐Ÿ‘พ", "๐Ÿค–", "๐ŸŽƒ", "๐Ÿ˜บ", "๐Ÿ˜ธ", "๐Ÿ˜น", "๐Ÿ˜ป", "๐Ÿ˜ผ", "๐Ÿ˜ฝ", "๐Ÿ™€", "๐Ÿ˜ฟ", "๐Ÿ˜พ", "๐Ÿ‘", "๐Ÿ™Œ", "๐Ÿ‘", "๐Ÿ™", "๐Ÿค", "๐Ÿ‘", "๐Ÿ‘Ž", "๐Ÿ‘Š", "โœŠ",
"๐Ÿค›", "๐Ÿคœ", "๐Ÿคž", "โœŒ๏ธ", "๐Ÿค˜", "๐Ÿ‘Œ", "๐Ÿ‘ˆ", "๐Ÿ‘‰", "๐Ÿ‘†", "๐Ÿ‘‡", "โ˜๏ธ", "โœ‹", "๐Ÿคš", "๐Ÿ–", "๐Ÿ––", "๐Ÿ‘‹", "๐Ÿค™", "๐Ÿ’ช", "๐Ÿ–•", "โœ๏ธ", "๐Ÿคณ",
"๐Ÿ’…", "๐Ÿ––", "๐Ÿ’„", "๐Ÿ’‹", "๐Ÿ‘„", "๐Ÿ‘…", "๐Ÿ‘‚", "๐Ÿ‘ƒ", "๐Ÿ‘ฃ", "๐Ÿ‘", "๐Ÿ‘€", "๐Ÿ—ฃ", "๐Ÿ‘ค", "๐Ÿ‘ฅ", "๐Ÿ‘ถ", "๐Ÿ‘ฆ", "๐Ÿ‘ง", "๐Ÿ‘จ", "๐Ÿ‘ฉ", "๐Ÿ‘ฑ"
];
function emojiHash (message) {
let hash = crypto.createHash('sha256').update(message).digest('base64').toString().split("");
var emojiForm = [];
for (var i = 0; i < hash.length; i++) {
emojiForm.push(
emoji_list[hash[i].charCodeAt(0)]
);
}
return emojiForm.join("");
}
module.exports = emojiHash;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment