f6ccdc3c51******
这种可以解得出来吗?
跪谢!
------解决方案--------------------
package com.lenovo.utils;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.log4j.Logger;
public class MD5
{
public static Logger log = Logger.getLogger(MD5.class);
private static final char[] ENCODE_TABLE = { '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
public static final String convert(String s)
{
MessageDigest alg;
try
{
alg = MessageDigest.getInstance("MD5");
alg.update(s.getBytes());
byte[] digesta = alg.digest();
return toHexString(digesta);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return null;
}
}
public static String toHexString(byte[] bytes)
{
StringBuffer result = new StringBuffer();
for (int i = 0; i < bytes.length; ++i) {
byte c = bytes[i];
result.append(ENCODE_TABLE[(c >> 4 & 0xF)]);
result.append(ENCODE_TABLE[(c & 0xF)]);
}
return result.toString();
}
}