国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > JS > 正文

文本加密解密

2024-09-06 12:45:23
字體:
來源:轉載
供稿:網友

第一步:把如下代碼加入到<head>區域中

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Encrypt(theText) {
output = new String;
Temp = new Array();
Temp2 = new Array();
TextSize = theText.length;
for (i = 0; i < TextSize; i++) {
rnd = Math.round(Math.random() * 122) + 68;
Temp[i] = theText.charCodeAt(i) + rnd;
Temp2[i] = rnd;
}
for (i = 0; i < TextSize; i++) {
output += String.fromCharCode(Temp[i], Temp2[i]);
}
return output;
}
function unEncrypt(theText) {
output = new String;
Temp = new Array();
Temp2 = new Array();
TextSize = theText.length;
for (i = 0; i < TextSize; i++) {
Temp[i] = theText.charCodeAt(i);
Temp2[i] = theText.charCodeAt(i + 1);
}
for (i = 0; i < TextSize; i = i+2) {
output += String.fromCharCode(Temp[i] - Temp2[i]);
}
return output;
}
//  End -->
</script>


第二步:把如下代碼加入到<body>區域中

<center>
<form name=encform onsubmit="return false;">
    <textarea name=box1 rows=5 cols=50>Typhoon Start JavaScript Fairyland

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 吉林市| 南投县| 桂东县| 渭源县| 黄山市| 时尚| 措勤县| 博白县| 孝昌县| 通辽市| 浦城县| 香格里拉县| 阿拉善左旗| 科技| 常宁市| 安多县| 调兵山市| 长汀县| 凤庆县| 通山县| 太白县| 阳西县| 秦皇岛市| 广安市| 丹东市| 信宜市| 西藏| 郯城县| 双流县| 江源县| 武穴市| 高雄县| 易门县| 渭南市| 龙口市| 嘉义县| 定襄县| 长葛市| 陇西县| 神池县| 营口市|