-
-
Save pldubouilh/32d513f60736138627a2 to your computer and use it in GitHub Desktop.
Visualize SSH public key fingerprints using Unicode emoji
This file contains hidden or 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
// Taken from Oona Rรคisรคnen 2013 / http://windytan.com | |
// Adapted to work well with b64 encoded keys | |
// ssh-keygen -lf ~/.ssh/id.pub | node emoji.js | |
var glyphs = [ '๐','๐','๐ ','๐','๐','๐','๐','๐ ','๐ฐ','๐ฑ','๐ฒ','๐ณ','๐ด','๐ต','๐ท','๐ธ', | |
'๐น','๐บ','๐ป','๐ผ','๐ฝ','๐พ','๐ฟ','๐','๐','๐','๐','๐','๐ ','๐','๐','๐', | |
'๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐', | |
'๐','๐','๐','๐','๐ ','๐ก','๐ข','๐ฃ','๐ค','๐ฅ','๐ฆ','๐ง','๐จ','๐ฉ','๐ช','๐ซ', | |
'๐ฌ','๐ญ','๐ฎ','๐ฏ','๐ฐ','๐ฑ','๐ฒ','๐ณ','๐ด','๐ต','๐ถ','๐ท','๐ธ','๐น','๐บ','๐ป', | |
'๐ผ','๐','๐','๐','๐','๐','๐ ','๐','๐','๐','๐','๐','๐','๐','๐','๐', | |
'๐','๐ ','๐ก','๐ข','๐ฃ','๐ค','๐ฅ','๐ฆ','๐ง','๐จ','๐ฉ','๐ช','๐ซ','๐ฌ','๐ญ','๐ฎ', | |
'๐ฏ','๐ฐ','๐ฑ','๐ฒ','๐ณ','๐ด','๐ต','๐ท','๐ธ','๐น','๐บ','๐ป','๐ฝ','๐พ','๐ฟ','๐', | |
'๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐ ','๐', | |
'๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐', | |
'๐','๐','๐','๐','๐','๐','๐','๐','๐','๐ ','๐ก','๐ข','๐ฃ','๐ค','๐ฅ','๐ฆ', | |
'๐ง','๐จ','๐ฉ','๐ช','๐ซ','๐ฌ','๐ญ','๐ฎ','๐ฏ','๐ฐ','๐ฑ','๐ฒ','๐ณ','๐ด','๐ต','๐ถ', | |
'๐ท','๐ธ','๐น','๐บ','๐ป','๐ผ','๐ฝ','๐พ','๐','๐','๐','๐','๐ ','๐','๐','๐', | |
'๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐','๐', | |
'๐','๐','๐','๐','๐','๐','๐','๐ ','๐ก','๐ข','๐ฃ','๐ค','๐ฅ','๐ฆ','๐ง','๐จ', | |
'๐ฉ','๐ช','๐ฎ','๐ฏ','๐บ','๐ป','๐ผ','๐ฝ','๐พ','๐ฟ','๐','๐','๐','๐','๐','๐ '] | |
var data = ''; | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
process.stdin.on('data', function(chunk) { | |
data += chunk; | |
}); | |
process.stdin.on('end', function() { | |
var hash = Buffer(data.split(' ')[1].split(':')[1], 'base64') | |
for (var i=0; i < hash.length; i++) | |
for(j in glyphs) | |
if (hash[i] == j) | |
process.stdout.write(glyphs[j] + ' ') | |
process.stdout.write('\n') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment