Created
August 13, 2017 20:39
-
-
Save ChrisCates/b4c60be6dff2b4c1ee09e797d0a8d1d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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