java关于android 的问题,这段代码是什么意思? 15
importjava.io.PrintStream;importjava.security.MessageDigest;importjava.security.NoSuc...
import java.io.PrintStream;import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class MD5Util{
public MD5Util() {
}
public static String getMD5Encoding(String s)
{
byte abyte0[];
String s1;
char ac[];
abyte0 = s.getBytes();
s1 = null;
ac = (new char[] {
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null
});
byte abyte1[];
char ac1[];
int i;
MessageDigest messagedigest = MessageDigest.getInstance("MD5");
messagedigest.update(abyte0);
abyte1 = messagedigest.digest();
ac1 = new char[32];
i = 0;
_L3:
if (i < 16) goto _L2; else goto _L1
_L1:
s1 = new String(ac1);
_L4:
return s1;
_L2:
byte byte0 = abyte1[i];
int j = i * 2;
int k = byte0 >>> 4 & 0xf;
char c = ac[k];
ac1[j] = c;
int l = i * 2 + 1;
int i1 = byte0 & 0xf;
char c1 = ac[i1];
ac1[l] = c1;
i++;
goto _L3
printStackTrace();
goto _L4
}
public static void main(String args[]) {
String s = getMD5Encoding("tarena");
System.out.println(s);
StringBuffer stringbuffer = new StringBuffer();
StringBuffer stringbuffer1 = stringbuffer.append("huayins");
StringBuffer stringbuffer2 = stringbuffer.append("0779257096");
PrintStream printstream = System.out;
String s1 = getMD5Encoding(stringbuffer.toString());
printstream.println(s1);
System.out.println("=============");
StringBuffer stringbuffer3 = new StringBuffer();
StringBuffer stringbuffer4 = stringbuffer3.append("shanghai").append("huayins").append("0779257096");
StringBuffer stringbuffer5 = new StringBuffer();
StringBuffer stringbuffer6 = stringbuffer5.append("shanghai").append("changnq").append("huayins").append("0779257096");
PrintStream printstream1 = System.out;
StringBuilder stringbuilder = new StringBuilder("?????б?->");
String s2 = getMD5Encoding(stringbuffer3.toString());
String s3 = stringbuilder.append(s2).toString();
printstream1.println(s3);
PrintStream printstream2 = System.out;
StringBuilder stringbuilder1 = new StringBuilder("???б?->");
String s4 = getMD5Encoding(stringbuffer5.toString());
String s5 = stringbuilder1.append(s4).toString();
printstream2.println(s5);
StringBuffer stringbuffer7 = new StringBuffer();
StringBuffer stringbuffer8 = stringbuffer7.append("huayins").append("0779257096");
PrintStream printstream3 = System.out;
StringBuilder stringbuilder2 = new StringBuilder("???б?->");
String s6 = getMD5Encoding(stringbuffer7.toString());
String s7 = stringbuilder2.append(s6).toString();
printstream3.println(s7); 展开
import java.security.NoSuchAlgorithmException;
public class MD5Util{
public MD5Util() {
}
public static String getMD5Encoding(String s)
{
byte abyte0[];
String s1;
char ac[];
abyte0 = s.getBytes();
s1 = null;
ac = (new char[] {
null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null
});
byte abyte1[];
char ac1[];
int i;
MessageDigest messagedigest = MessageDigest.getInstance("MD5");
messagedigest.update(abyte0);
abyte1 = messagedigest.digest();
ac1 = new char[32];
i = 0;
_L3:
if (i < 16) goto _L2; else goto _L1
_L1:
s1 = new String(ac1);
_L4:
return s1;
_L2:
byte byte0 = abyte1[i];
int j = i * 2;
int k = byte0 >>> 4 & 0xf;
char c = ac[k];
ac1[j] = c;
int l = i * 2 + 1;
int i1 = byte0 & 0xf;
char c1 = ac[i1];
ac1[l] = c1;
i++;
goto _L3
printStackTrace();
goto _L4
}
public static void main(String args[]) {
String s = getMD5Encoding("tarena");
System.out.println(s);
StringBuffer stringbuffer = new StringBuffer();
StringBuffer stringbuffer1 = stringbuffer.append("huayins");
StringBuffer stringbuffer2 = stringbuffer.append("0779257096");
PrintStream printstream = System.out;
String s1 = getMD5Encoding(stringbuffer.toString());
printstream.println(s1);
System.out.println("=============");
StringBuffer stringbuffer3 = new StringBuffer();
StringBuffer stringbuffer4 = stringbuffer3.append("shanghai").append("huayins").append("0779257096");
StringBuffer stringbuffer5 = new StringBuffer();
StringBuffer stringbuffer6 = stringbuffer5.append("shanghai").append("changnq").append("huayins").append("0779257096");
PrintStream printstream1 = System.out;
StringBuilder stringbuilder = new StringBuilder("?????б?->");
String s2 = getMD5Encoding(stringbuffer3.toString());
String s3 = stringbuilder.append(s2).toString();
printstream1.println(s3);
PrintStream printstream2 = System.out;
StringBuilder stringbuilder1 = new StringBuilder("???б?->");
String s4 = getMD5Encoding(stringbuffer5.toString());
String s5 = stringbuilder1.append(s4).toString();
printstream2.println(s5);
StringBuffer stringbuffer7 = new StringBuffer();
StringBuffer stringbuffer8 = stringbuffer7.append("huayins").append("0779257096");
PrintStream printstream3 = System.out;
StringBuilder stringbuilder2 = new StringBuilder("???б?->");
String s6 = getMD5Encoding(stringbuffer7.toString());
String s7 = stringbuilder2.append(s6).toString();
printstream3.println(s7); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询