fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10.  
  11.  
  12.  
  13. public static void main (String[] args) throws java.lang.Exception
  14. {
  15. String phone = "79992331101";
  16. System.out.println(MD5(phone) + "saltfromhash");
  17. System.out.println(MD5(MD5(phone) + "saltfromhash"));
  18. }
  19.  
  20. static public String MD5(String md5) {
  21. try {
  22. java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5");
  23. byte[] array = md.digest(md5.getBytes());
  24. for (int i = 0; i < array.length; ++i) {
  25. sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1,3));
  26. }
  27. return sb.toString();
  28. } catch (java.security.NoSuchAlgorithmException e) {
  29. }
  30. return null;
  31. }
  32.  
  33. }
Success #stdin #stdout 0.06s 4386816KB
stdin
Standard input is empty
stdout
92adb8067a5854746adc8a974aab37bcsaltfromhash
8192416d0a5fc52209789173df887c96