Java MD5 String md5(String userPass)

Here you can find the source of md5(String userPass)

Description

md

License

Apache License

Declaration

public static String md5(String userPass) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.math.BigInteger;

public class Main {
    public static String md5(String userPass) throws Exception {

        java.security.MessageDigest md5 = java.security.MessageDigest
                .getInstance("MD5");
        md5.update(userPass.getBytes());

        byte b[] = md5.digest();

        return new BigInteger(b).toString(16);
    }/*w ww.j av  a  2 s.co  m*/
}

Related

  1. md5(String text)
  2. md5(String text)
  3. md5(String text, String charset)
  4. md5(String text, String key)
  5. md5(String txt)
  6. md5(String value)
  7. md5(String value)
  8. md5(String value)
  9. md5(String value)