Created
January 7, 2012 11:00
-
-
Save kopiro/1574438 to your computer and use it in GitHub Desktop.
L33T Converter
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
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