DécodageCode source <HTML><HEAD> <TITLE>ascii</TITLE> <style type="text/css"> a {text-decoration:none} a:hover {background-color:teal;color:yellow} INPUT {Color: #2207B8;Background-Color: #ff8000;font-weight:bold;} TEXTAREA{Color: #2207B8;Background-Color: #ff8000;font-weight:bold;} select{Color: #2207B8;Background-Color: #ff8000;font-weight:bold;} </style> </HEAD> <BODY bgcolor=navy> <div align=center> <table width=800 bgcolor=lightgreen><tr><td> <div align=center> <H1>Décodage</H1> <FORM NAME="form1" action="ascii2.htm?"> Texte à décoder <INPUT TYPE="text" NAME="longueur" SIZE= "80" > <input type="hidden" name="l" value="1"> <BR> <font size=4><BR> <input type="submit" value=" Valider"> <BR> </FORM> <HR> <script language="JavaScript"> <!-- var requete = window.location.search ; if (requete) { requete=requete.substring(1) ; requete = unescape(requete) ; } var elem = requete.split('&'); l1= elem[0]; l2 = elem[1]; var fin1 = l1.split('='); var fin2 = l2.split('='); Chaine=fin1[1]; code=fin2[1]; var mot=Chaine; var codes=""; document.write("<font size=3><B><U>Chiffrage à décoder:</U> ") document.write(mot+"</B><br>"); document.write("<BR><B><U>Décodage</U></B><br>"); decode=""; var chaine=mot; var reg=new RegExp("[ ,;]+", "g"); // document.write("Chaîne d'origine : " + chaine + "<BR>"); var lettre=chaine.split(reg); for (var i=0; i<lettre.length; i++) { xx=String.fromCharCode(lettre[i]); document.write("lettre[" + i + "] = " + lettre[i] + " -> "+xx+"<BR>"); decode=decode+xx; } document.write("<BR><B><U>Texte décodé:</U> " ); document.write(decode+" </B><BR>"); --> </script> <HR> </td></tr> </table> </div> <HR> </BODY> </HTML> |