import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class SetSercert {
/**
* @param args
* @throws NoSuchAlgorithmException
*/
public static void main(String[] args) throws NoSuchAlgorithmException {
String pwd = "123456";
MessageDigest digest = MessageDigest.getInstance("md5");
byte[] bytes = digest.digest(pwd.getBytes());
StringBuilder builder = new StringBuilder();
for (byte b : bytes) {
int num = (b & 0xff);
String str = Integer.toHexString(num);
if (str.length() == 1) {
builder.append(0);
}
builder.append(str);
}
System.out.println(builder);
}
}
import java.security.NoSuchAlgorithmException;
public class SetSercert {
/**
* @param args
* @throws NoSuchAlgorithmException
*/
public static void main(String[] args) throws NoSuchAlgorithmException {
String pwd = "123456";
MessageDigest digest = MessageDigest.getInstance("md5");
byte[] bytes = digest.digest(pwd.getBytes());
StringBuilder builder = new StringBuilder();
for (byte b : bytes) {
int num = (b & 0xff);
String str = Integer.toHexString(num);
if (str.length() == 1) {
builder.append(0);
}
builder.append(str);
}
System.out.println(builder);
}
}