import java.security.MessageDigest;
public class MainClass {
public static void main(String args[]) throws Exception {
String name = "name";
String passwd = "password";
String salts = "12,12,12";
String salttmp[] = salts.split(",");
byte salt[] = new byte[salttmp.length];
for (int i = 0; i < salt.length; i++) {
salt[i] = Byte.parseByte(salttmp[i]);
}
MessageDigest m = MessageDigest.getInstance("MD5");
m.update(salt);
m.update("name".getBytes("UTF8"));
byte s[] = m.digest();
String result = "";
for (int i = 0; i < s.length; i++) {
result += Integer.toHexString((0x000000ff & s[i]) | 0xffffff00).substring(6);
}
System.out.println(result.equals(passwd));
}
}