国产探花免费观看_亚洲丰满少妇自慰呻吟_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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 合山市| 红河县| 页游| 永嘉县| 林甸县| 松溪县| 连云港市| 宣化县| 诏安县| 盐池县| 苏州市| 诸暨市| 夏津县| 曲周县| 郓城县| 中宁县| 仙居县| 定西市| 长白| 绥宁县| 沙田区| 绵阳市| 逊克县| 山阳县| 松溪县| 十堰市| 邛崃市| 墨玉县| 巴里| 鲁甸县| 建宁县| 大庆市| 沿河| 金阳县| 昌乐县| 商都县| 宁陕县| 娄烦县| 阳信县| 夹江县| 海丰县|