问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

...+字母,请问是什么加密方式,加密成的值字母区分大小写。

发布网友 发布时间:2024-09-27 11:33

我来回答

1个回答

热心网友 时间:2024-09-27 20:09

这个加密不知道行不行?
public class Escape {
private final static String[] hex = { "00", "01", "02", "03", "04", "05",
"06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "1A", "1B",
"1C", "1D", "1E", "1F", "20", "21", "22", "23", "24", "25", "26",
"27", "28", "29", "2A", "2B", "2C", "2D", "2E", "2F", "30", "31",
"32", "33", "34", "35", "36", "37", "38", "39", "3A", "3B", "3C",
"3D", "3E", "3F", "40", "41", "42", "43", "44", "45", "46", "47",
"48", "49", "4A", "4B", "4C", "4D", "4E", "4F", "50", "51", "52",
"53", "54", "55", "56", "57", "58", "59", "5A", "5B", "5C", "5D",
"5E", "5F", "60", "61", "62", "63", "64", "65", "66", "67", "68",
"69", "6A", "6B", "6C", "6D", "6E", "6F", "70", "71", "72", "73",
"74", "75", "76", "77", "78", "79", "7A", "7B", "7C", "7D", "7E",
"7F", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89",
"8A", "8B", "8C", "8D", "8E", "8F", "90", "91", "92", "93", "94",
"95", "96", "97", "98", "99", "9A", "9B", "9C", "9D", "9E", "9F",
"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "AA",
"AB", "AC", "AD", "AE", "AF", "B0", "B1", "B2", "B3", "B4", "B5",
"B6", "B7", "B8", "B9", "BA", "BB", "BC", "BD", "BE", "BF", "C0",
"C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "CA", "CB",
"CC", "CD", "CE", "CF", "D0", "D1", "D2", "D3", "D4", "D5", "D6",
"D7", "D8", "D9", "DA", "DB", "DC", "DD", "DE", "DF", "E0", "E1",
"E2", "E3", "E4", "E5", "E6", "E7", "E8", "E9", "EA", "EB", "EC",
"ED", "EE", "EF", "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7",
"F8", "F9", "FA", "FB", "FC", "FD", "FE", "FF" };

private final static byte[] val = { 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x00, 0x01,
0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F };

/**
* Unicode 格式 编码
*
* @param s
* @return
*/
public static String escape(String s) {
StringBuffer sbuf = new StringBuffer();
int len = s.length();
for (int i = 0; i < len; i++) {
int ch = s.charAt(i);
if ('A' <= ch && ch <= 'Z') {
sbuf.append((char) ch);
} else if ('a' <= ch && ch <= 'z') {
sbuf.append((char) ch);
} else if ('0' <= ch && ch <= '9') {
sbuf.append((char) ch);
} else if (ch == '-' || ch == '_'
|| ch == '.' || ch == '!' || ch == '~' || ch == '*'
|| ch == '\'' || ch == '(' || ch == ')') {
sbuf.append((char) ch);
} else if (ch <= 0x007F) {
sbuf.append('%');
sbuf.append(hex[ch]);
} else {
sbuf.append('%');
sbuf.append('u');
sbuf.append(hex[(ch >>> 8)]);
sbuf.append(hex[(0x00FF & ch)]);
}
}
return sbuf.toString();
}

/**
* 解码 说明:本方法保证 不论参数s是否经过escape()编码,均能得到正确的“解码”结果
*
* @param s
* @return
*/
public static String unescape(String s) {
StringBuffer sbuf = new StringBuffer();
int i = 0;
int len = s.length();
while (i < len) {
int ch = s.charAt(i);
if ('A' <= ch && ch <= 'Z') {
sbuf.append((char) ch);
} else if ('a' <= ch && ch <= 'z') {
sbuf.append((char) ch);
} else if ('0' <= ch && ch<= '9') {
sbuf.append((char) ch);
} else if (ch == '-' || ch == '_'|| ch == '.' || ch == '!' || ch == '~' || ch == '*'|| ch == '\'' || ch == '(' || ch == ')') {
sbuf.append((char) ch);
} else if (ch == '%') {
int cint = 0;
if ('u' != s.charAt(i + 1)) {
cint = (cint << 4) | val[s.charAt(i + 1)];
cint = (cint << 4) | val[s.charAt(i + 2)];
i += 2;
} else {
cint = (cint << 4) | val[s.charAt(i + 2)];
cint = (cint << 4) | val[s.charAt(i + 3)];
cint = (cint << 4) | val[s.charAt(i + 4)];
cint = (cint << 4) | val[s.charAt(i + 5)];
i += 5;
}
sbuf.append((char) cint);
} else {
sbuf.append((char) ch);
}
i++;
}
return sbuf.toString();
}
/**
* 把unicode编码转换成正常字符
*
* @param hex
* @return
*/
public static String binaryToUnicode(String hex) {
String strContent = "";
try {
int i;
int n;
int j;
n = hex.length() / 4;
j = 0;
char[] content = new char[n];
for (i = 0; i < n; i++) {
j = i * 4;
content[i] = (char) Integer.parseInt(hex.substring(j, j + 4),
16);
}
strContent = new String(content);
} catch (Exception ex) {
ex.printStackTrace();
strContent = "";
}
return strContent;
}

/**
* 把字符转换成unicode编码
*
* @param content
* @return
*/
public static String unicodeToBinary(String content) {
String hexStr = "";

try {
char[] contentBuffer = content.toCharArray();
String s;
int n;

for (int i = 0; i < content.length(); i++) {
n = (int) contentBuffer[i];
s = Integer.toHexString(n);

if (s.length() > 4) {
s = s.substring(0, 4);
} else {
s = "0000".substring(0, 4 - s.length()) + s;
}

hexStr = hexStr + s;
}
} catch (Exception ex) {
hexStr = "";
}

return hexStr.toUpperCase();
}

public static void main(String[] args) {
// String stest = "\"asd请选择";
// System.out.println(escape(stest));
// System.out.println(unescape(escape(stest))+"||"+unescape(stest));
// System.out.println("0----9:"+(int)'0'+"--------"+(int)'9');
// System.out.println("A----Z:"+(int)'A'+"--------"+(int)'Z');
// System.out.println("a----z:"+(int)'a'+"--------"+(int)'z');
// System.out.println("-:"+(int)'-'+"||" +(int)'_'+"||"+(int)'.'
// +"||" +(int)'!'+"||"
// +(int)'~'+"||"+(int)'*'+"||"+(int)'\''+"||"
// +(int)'('+"||"+(int)')'+"||");
// for (int i = 0; i < 128; i++) {
// if (i%10==0) {
// System.out.print(" "+i+"="+(char)i+"\n");
// }else{
// System.out.print(" "+i+"="+(char)i);
// }
// // char ch = (char)i;
// // if (ch == '-' || ch == '_'|| ch == '.' || ch == '!' || ch == '~' || ch == '*'|| ch == '\'' || ch == '(' || ch == ')') {
// // System.out.println(ch+"="+(int)ch+" ");
// // }
// }unescape(String s)
System.out.println(Escape.unescape("撒33范德萨"));
System.out.println(Escape.unicodeToBinary("战略绩效计划调整"));
System.out.println(Escape.binaryToUnicode("621875657EE965488BA152128C036574"));
System.out.println(Escape.unescape("%u6492%u8303%u5FB7%u8428%u9426"));
}
}
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
大学入学应该带哪些必备物品? tim删除聊天记录的方法步骤 pc端彻底删除tim聊天记录 甩脂机调到什么档位 如何用甩脂机 甩脂机的正确使用方法 使用抖脂机要注意什么 怎样申请小号微信号 ...的长和宽分别增加6米,扩建后草坪的面积增加了多少 ...扩建后长和宽分别增加10米,扩建后的操场面积增加了多少平方米?_百 ... 长方形的公园它的面积长和宽分别扩大十米后它的平方增加了面积增加了13... 推荐几部超长小说,完结的,10m左右,只有能打发时间就行 2020年6月28日周日盐田社保局正常上班吗? 2020年6月28日巴中交警队办证大厅上班吗? 2020年6月28日,成都事故处理中心上班么? ...本人想买辆摩托车、看上了幻影150、和锐爽EN150、那辆性能质量比较... 铃木锐爽,本田幻影那个最好 什么网站查股票信息 如何使用PS将照片快速制作成粉笔画海报? 什么是个股查询 word如何复制一页内容 如何在word里把一页的内容复制到别的文档里 向台湾探亲需要台湾那边出示入台许可证 “看似寻常最奇崛,成如容易却艰辛”是什么意思_出处是哪里 看似寻常最奇崛成如容易却艰辛的意思 看似寻常最奇崛成如容易却... 要考大学语文,。 我目前也要用coreldraw制作名片。需要上传个公司的LOGO。名片中间需要... 华为mate30带不带无线充电 供1台电梯,50台空调要用多大的发电机 小区电梯90kw电机需要配置多大的发电机组 微信收款码可以绑定个人银行卡吗? 谁帮我查一下ems到哪了 ee626257915cs 字母是大写的 老公信用卡网贷没还完我有连带责任吗? 2020最新工伤死亡赔偿标准是如何规定的 肤色不均怎么办? 面部肤色不均匀,有什么方法可以改善? 暗沉发黄又不均匀的肤色该用什么方法改善? ...起把几个人的高铁票一起买了,取票的时候还是需要所有人的身份吗... 三花国际对面的那个商住叫什么? 吃虫草的话,可以补肾吗?有晓得的吗? 魅蓝Note和红米Note拍照:系统界面操作有差别? 江西大专院校有哪些,2015年江西大专院校排名及录取分数线 江西省五年一贯制专科分数线是多少 打人两拳如何处理 人家打人轻伤,我也帮人打了两拳,我能被判刑吗 我是学会计专业的,现在有一个从事会计的机会,先从事会计工作,在报考会 ... oppo手机窗口超过上限怎么办 ie9搜搜绑定了搜索引擎 怎么解决 摩托车发动机发烫严重没力怎么回事? ...完了,窗户玻璃装完了,绿化还没做配套道路正在修,多久可以交房... 不小心把OFFICE 2003给卸载了,下了好几个总是显示你的系统中没有所需... 用360软件管家卸载了office2003之后,不管按什么东西,都会跳出office2003...