SIFROVAC (2)

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

 

025
p025.html / p025.zip
Zasifruje vlozeny retazec podla zadanej aditivnej hodnoty
1403b
NN 4.04, IE 4.0

UKAZKA / CLICK HERE

Zdrojovy tvar / Source code:

<HTML> <HEAD> <TITLE> JavaScript DESTINATION - T025 </TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- function testEncode(form) { var Ret = encode (form.inputbox1.value,form.inputbox2.value); form.inputbox3.value = 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> Retazec: <td> <INPUT TYPE="text" NAME="inputbox1" VALUE=""><P> </td></tr><tr> <td align=center> Hodnota aditivnej sifry: <td> <INPUT TYPE="text" NAME="inputbox2" VALUE="4"> </td></tr><tr><td> Zakodovany retazec: <td> <INPUT TYPE="text" NAME="inputbox3" VALUE=""> <tr> <td colspan=2 align=center> <INPUT TYPE="button" NAME="button" Value="Zakodoj" onClick="testEncode(this.form)"><BR> </td></tr> </table> </form> </body> </html>
[ Navrat / BACK ]