Here you can find the source of decrypt(String src)
Parameter | Description |
---|---|
src | a parameter |
public static String decrypt(String src)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w . j a v a2 s . co m * decrypt * * @param src * @return */ public static String decrypt(String src) { String ecrt = ""; for (int i = 0; i < src.length(); i++) { char a = src.charAt(i); if (a == '#') { ecrt += "0"; } else if (a == '&') { ecrt += "1"; } else if (a == '2') { ecrt += "2"; } else if (a == '@') { ecrt += "3"; } else if (a == 'W') { ecrt += "4"; } else if (a == '!') { ecrt += "5"; } else if (a == '~') { ecrt += "6"; } else if (a == '*') { ecrt += "7"; } else if (a == ')') { ecrt += "8"; } else if (a == '_') { ecrt += "9"; } else if (a == 'V') { ecrt += "A"; } else if (a == 'Y') { ecrt += "B"; } else if (a == '^') { ecrt += "C"; } else if (a == '+') { ecrt += "D"; } else if (a == '%') { ecrt += "E"; } else if (a == '(') { ecrt += "F"; } } String dcode = decode(ecrt); return dcode; } public static String decode(String s) { byte[] baKeyword = new byte[s.length() / 2]; for (int i = 0; i < baKeyword.length; i++) { try { baKeyword[i] = (byte) (0xff & Integer.parseInt(s.substring(i * 2, (i * 2) + 2), 16)); } catch (Exception e) { e.printStackTrace(); } } try { s = new String(baKeyword, "GB2312");// UTF-16le:Not } catch (Exception e1) { e1.printStackTrace(); } return s; } }