SIFROVAC

ID
Nazov / Name:
Popis / Description:
Dlzka / Length:
Testovane pod / Tested under:

 

024
p024.html / p024.zip
Zasifruje vlozeny text aditivnou sifrou
1147b
NN 4.04, IE 4.0

UKAZKA / CLICK HERE

Zdrojovy tvar / Source code:

<HTML> <HEAD> <TITLE> JavaScript DESTINATION - P024 </TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- function testEncode(form) { var Ret = encode (form.inputbox1.value, form.inputbox2.value) alert(Ret); } function encode (OrigString, CipherVal) { Ref="0123456789abcdefghijklmnopqrstuvwxyz._~ABCDEFGHIJKLMNOPQRSTUVWXYZ" CipherVal = parseInt(CipherVal) var Temp="" for (Count=0; Count < OrigString.length; Count++) { var TempChar = OrigString.substring (Count, Count+1) var Conv = cton(TempChar) var Cipher=Conv^CipherVal Cipher=ntoc(Cipher) Temp += Cipher } return (Temp) } function cton (Char) { return (Ref.indexOf(Char)); } function ntoc (Val) { return (Ref.substring(Val, Val+1)) } // --> </SCRIPT> </HEAD> <BODY> <FORM> <table> <tr><td> <INPUT TYPE="text" NAME="inputbox1" VALUE=""><P> </td></tr><tr> <td align=center> <INPUT TYPE="hidden" NAME="inputbox2" VALUE="4"> <INPUT TYPE="button" NAME="button" Value="Zakoduj" onClick="testEncode(this.form)"><BR> </td></tr> </table> </form> </body> </html>
[ Navrat / BACK ]