Friday, June 13, 2014

Friday Fun: l337 Speek Translator

So, maybe you're not L337 'nough to make your own l337 5P33|< translations.  Here's some help along the way.  The following HTML script will give you a really simple page to translate plain text.

-Matt


<html>
<head>
<title>L337 #4X0r 5p3e|&lt;</title>
<script language="javascript">

    var x1at = [
        ['A', 'a', '4', '@', '/-\\' ],
        ['B','b','5','&amp;','8'],
        ['C','c','&cent','(','{','['],
        ['D','d','|)','|}','|]','|&gt;'],
        ['E','e','3','3','3','3'],
        ['F','f'],
        ['G','6','g'],
        ['H','#','h'],
        ['I','i','1','|','l'],
        ['J','j','|'],
        ['K','k', '|&lt;'],
        ['L','l','1','!','|_'],
        ['M','m','|\\/|','^^'],
        ['N','^','n','|\\|'],
        ['O','o','0','()','[]','{}','&lt;&gt;'],
        ['P','p','p','P'],
        ['Q','q','9','q','9'],
        ['R','r','rrr','R'],
        ['S','s','5','$'],
        ['T','t','7','+'],
        ['U','u','|_|'],
        ['V','v','\\/','`\''],
        ['W','vv','w','\\/\\/'],
        ['X','%','x','*'],
        ['Y','y','`\'|'],
        ['Z','z','-/_','%'],
    ]


    function x147e() {
        var l337 = document.getElementById("L337");
        var _5Rc = document.getElementById("_5Rc");
        var c0un7 = document.getElementById("c0un7");

        l337.innerHTML = "";

        for (var x = 0; x < _5Rc.value.length; x++) {
            c = _5Rc.value.charAt(x).toUpperCase();
            if (c >= 'A' && c <= 'Z') {
                var i = c.charCodeAt(0) - 'A'.charCodeAt(0);

                l337.innerHTML += x1at[i][Math.floor(x1at[i].length
                                         * (Math.random() - 0.0001)) ];
            } else {
                l337.innerHTML += c;
            }
        }

        c0un7.innerText = "Char Count:" + l337.innerText.length;
       
    }
</script>
</head>
<body>

<div id="L337" style="white-space: pre; font-family:Trebuchet MS; 
                        font-size:14px; width:400px; padding:10px; 
                        border:1px solid black; margin-bottom:5px"></div>

<div id="c0un7" style="font-size:14px; font-family:Trebuchet MS; 
                        margin-bottom:5px; padding:10px">Char Count:</div>

<textarea id="_5Rc" cols="50" rows="5" style="margin-bottom:20px">
</textarea><br />

<button  onclick="x147e(); return false;">x147e</button>

</body>
</html>

No comments:

Post a Comment