[javascript] 주소를 암호화로 만들어 보자!
로빈아빠
본문
<html>
<SCRIPT LANGUAGE="JavaScript">
<!--
function encrypt(form) {
// the following letters and numbers and other characters are going
// to be encrypted.
letters = "abcdefghijklmnopqrstuvwxyz/.1234567890~_:";
encrypt = new Array(
"%61","%62","c","%64","e","%66",
"%67","%68","%69","%6a","%6b","%6c",
"m","n","o","%70","%71","%72",
"%73","t","%75","%76","w","%78",
"%79","%7a","/","."
,"1","2","3","4","5","6","7","8",
"9","0","~","_","!",":");
form.output.value = "";
var input = form.input.value;
output = "";
for(var count = 0; count < input.length; count++) {
daChar = input.charAt(count);
for (i = 0; i < letters.length; i++) {
if (daChar == letters.charAt(i)) {
output += encrypt[i];
break;
}
}
}
form.output.value = output;
}
// End -->
</script>
</head>
<body>
<form>
http:// 는 빼고 주소를 입력하세요
<input type=button value="암호화" onClick="javascript:encrypt(this.form)"><br>
<textarea name=input cols=50 rows=1 wrap=physical></textarea><BR>
암호화된 주소가 아래 나옵니다<br>
<textarea name=output cols=50 rows=1 wrap=physical></textarea>
</form>
</body>
</html>
[이 게시물은 VIRHAC님에 의해 2009-09-13 14:38:24 HTML에서 이동 됨]
<SCRIPT LANGUAGE="JavaScript">
<!--
function encrypt(form) {
// the following letters and numbers and other characters are going
// to be encrypted.
letters = "abcdefghijklmnopqrstuvwxyz/.1234567890~_:";
encrypt = new Array(
"%61","%62","c","%64","e","%66",
"%67","%68","%69","%6a","%6b","%6c",
"m","n","o","%70","%71","%72",
"%73","t","%75","%76","w","%78",
"%79","%7a","/","."
,"1","2","3","4","5","6","7","8",
"9","0","~","_","!",":");
form.output.value = "";
var input = form.input.value;
output = "";
for(var count = 0; count < input.length; count++) {
daChar = input.charAt(count);
for (i = 0; i < letters.length; i++) {
if (daChar == letters.charAt(i)) {
output += encrypt[i];
break;
}
}
}
form.output.value = output;
}
// End -->
</script>
</head>
<body>
<form>
http:// 는 빼고 주소를 입력하세요
<input type=button value="암호화" onClick="javascript:encrypt(this.form)"><br>
<textarea name=input cols=50 rows=1 wrap=physical></textarea><BR>
암호화된 주소가 아래 나옵니다<br>
<textarea name=output cols=50 rows=1 wrap=physical></textarea>
</form>
</body>
</html>
[이 게시물은 VIRHAC님에 의해 2009-09-13 14:38:24 HTML에서 이동 됨]
관련링크
댓글목록
등록된 댓글이 없습니다.