Skip to content

Instantly share code, notes, and snippets.

@kopiro
Created January 7, 2012 11:00
Show Gist options
  • Save kopiro/1574438 to your computer and use it in GitHub Desktop.
Save kopiro/1574438 to your computer and use it in GitHub Desktop.
L33T Converter
alphabet = {
'a':'4',
'b':'8',
'c':'[',
'd':'|)',
'e':'3',
'f':'|=',
'g':'6',
'h':'#',
'i':'1',
'j':'_|',
'k':'X',
'l':'7',
'm':'m',
'n':'//',
'o':'()',
'p':'|^',
'q':'[,]',
'r':'|2',
's':'5',
't':'+',
'u':'(_)',
'v':'\/',
'w':'\/\/',
'x':'><',
'y':'j',
'z':'%'
};
function convert_to_l33t (text)
{
text = text.toLowerCase();
var nt='';
for (var i=0; i<text.length; i++)
{
var c = alphabet[text[i]];
if (!c) nt += text[i];
else nt += c;
}
return nt;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment