<html><head><script>
function Encrypt(){
var monyer = new Array();var i;
for(i=0;i<txt.value.length;i++){
if(Decimal.checked) monyer+="&#"+txt.value.charCodeAt(i)+";";
else monyer+=txt.value.charCodeAt(i)+",";
}
txt.value=monyer;
}
function Decrypt(){
var monyer = new Array();var i;
if(Decimal.checked){
var s=txt.value.split(";");
for(i=0;i<s.length;i++){
s[i]=s[i].replace('&#','');
monyer+=String.fromCharCode(s[i]);
}
}else{
var s=txt.value.split(",");
for(i=0;i<s.length;i++)
monyer+=String.fromCharCode(s[i]);
}
txt.value=monyer;
}
function doit(f){
var monyer=document.getElementById('txt');
if(monyer) monyer.innerText=f(monyer.innerText);
}
function JavaEn(){
var monyer = new Array();var i,s;
for(i=0;i<txt.value.length;i++){
s=txt.value.charCodeAt(i).toString(16);
if(hex.checked) monyer+="\\u"+new Array(5-String(s).length).join("0")+s;
else if(hex2.checked) monyer+="&#x"+new Array(5-String(s).length).join("0")+s+";";
else monyer+="\\"+new Array(5-String(s).length).join("0")+s;
}
txt.value=monyer;
}
function JavaDe(){
if(hex.checked){
var monyer = new Array();var i;
var s=txt.value.split("\\");
for(i=1;i<s.length;i++){
s[i]=s[i].replace('u','');
monyer+=String.fromCharCode(parseInt(s[i],16));
}
}
else if(hex2.checked){
var monyer = new Array();var i;
var s=txt.value.split(";");
for(i=0;i<s.length;i++){
s[i]=s[i].replace('&#x','');
monyer+=String.fromCharCode(parseInt(s[i],16));
}
}
else{
var monyer = new Array();var i;
var s=txt.value.split("\\");
for(i=1;i<s.length;i++) monyer+=String.fromCharCode(parseInt(s[i],16));
}
txt.value=monyer;
}
</script></head><body>
<textarea id='txt' name='txt' cols=100 rows=35></textarea><br />
<input type='button' value='10进制加密' οnclick='Encrypt()'>
<input type='button' value='10进制解密' οnclick='Decrypt()'>
<input name="Decimal" type="checkbox" value="checkbox">
默认为“,”分隔;选中为“&#;”分隔
<br>
<input type='button' value='escape加密' οnclick='doit(escape)'><=>
<input type='button' value='unescape解密' οnclick='doit(unescape)'>
<br>
<input type='button' value='16进制加密' οnclick='JavaEn()'>
<input type='button' value='16进制解密' οnclick='JavaDe()'>
<input name="hex" type="checkbox" value="checkbox">
默认为“\”分隔;选中为“\u”分隔
<input name="hex2" type="checkbox" value="checkbox">
选中为“&#x;”分隔
</body></html>
function Encrypt(){
var monyer = new Array();var i;
for(i=0;i<txt.value.length;i++){
if(Decimal.checked) monyer+="&#"+txt.value.charCodeAt(i)+";";
else monyer+=txt.value.charCodeAt(i)+",";
}
txt.value=monyer;
}
function Decrypt(){
var monyer = new Array();var i;
if(Decimal.checked){
var s=txt.value.split(";");
for(i=0;i<s.length;i++){
s[i]=s[i].replace('&#','');
monyer+=String.fromCharCode(s[i]);
}
}else{
var s=txt.value.split(",");
for(i=0;i<s.length;i++)
monyer+=String.fromCharCode(s[i]);
}
txt.value=monyer;
}
function doit(f){
var monyer=document.getElementById('txt');
if(monyer) monyer.innerText=f(monyer.innerText);
}
function JavaEn(){
var monyer = new Array();var i,s;
for(i=0;i<txt.value.length;i++){
s=txt.value.charCodeAt(i).toString(16);
if(hex.checked) monyer+="\\u"+new Array(5-String(s).length).join("0")+s;
else if(hex2.checked) monyer+="&#x"+new Array(5-String(s).length).join("0")+s+";";
else monyer+="\\"+new Array(5-String(s).length).join("0")+s;
}
txt.value=monyer;
}
function JavaDe(){
if(hex.checked){
var monyer = new Array();var i;
var s=txt.value.split("\\");
for(i=1;i<s.length;i++){
s[i]=s[i].replace('u','');
monyer+=String.fromCharCode(parseInt(s[i],16));
}
}
else if(hex2.checked){
var monyer = new Array();var i;
var s=txt.value.split(";");
for(i=0;i<s.length;i++){
s[i]=s[i].replace('&#x','');
monyer+=String.fromCharCode(parseInt(s[i],16));
}
}
else{
var monyer = new Array();var i;
var s=txt.value.split("\\");
for(i=1;i<s.length;i++) monyer+=String.fromCharCode(parseInt(s[i],16));
}
txt.value=monyer;
}
</script></head><body>
<textarea id='txt' name='txt' cols=100 rows=35></textarea><br />
<input type='button' value='10进制加密' οnclick='Encrypt()'>
<input type='button' value='10进制解密' οnclick='Decrypt()'>
<input name="Decimal" type="checkbox" value="checkbox">
默认为“,”分隔;选中为“&#;”分隔
<br>
<input type='button' value='escape加密' οnclick='doit(escape)'><=>
<input type='button' value='unescape解密' οnclick='doit(unescape)'>
<br>
<input type='button' value='16进制加密' οnclick='JavaEn()'>
<input type='button' value='16进制解密' οnclick='JavaDe()'>
<input name="hex" type="checkbox" value="checkbox">
默认为“\”分隔;选中为“\u”分隔
<input name="hex2" type="checkbox" value="checkbox">
选中为“&#x;”分隔
</body></html>