ASCII码字符串普通加密解密-android

                  
            //android后台Java
             //ASCII加密
String str = e.getText().toString();
StringBuilder s = new StringBuilder();
char[] c = str.toCharArray();
for (int i = 0; i < str.length(); i++) {
int a = c[i];
a = a + 7;
s.append((char) a) ;
}

//ascll解密一
// String d = "";
// char[] c2 = s.toString().toCharArray();
// for (int i = 0; i < s.length(); i++) {
// int b = c2[i];
// b = b - 7;
// d = d + (char) b;
// }
//ascll解密二
StringBuilder d = new StringBuilder();
char[] c2 = s.toString().toCharArray();
for (int i = 0; i < s.length(); i++) {
int b = c2[i];
b = b - 7;
d.append((char) b);
}

ASCII码字符串普通加密解密-android

上一篇:手机在线编程软件Anycodes


下一篇:Android打造完美的刮刮乐效果控件