import java.security.MessageDigest;
import java.util.Random;
public class MainClass {
public static void main(String args[]) throws Exception {
String name = "name";
String passwd = "password";
Random rand = new Random();
byte[] salt = new byte[12];
rand.nextBytes(salt);
MessageDigest m = MessageDigest.getInstance("MD5");
m.update(salt);
m.update(passwd.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(name);
for (int i = 0; i < salt.length; i++) {
System.out.print(salt[i] + ",");
}
System.out.println(result);
}
}
/*name
72,83,-8,78,-82,125,0,-37,-116,-83,-72,27,460a21b49082e5268a4016bfa2e2885c*/