code: public static String getMD5Hash(String text) {
      MessageDigest md;
      byte[] md5hash = new byte[32];
      try {
        md = MessageDigest.getInstance("MD5");
        md.update(text.getBytes("iso-8859-1"), 0, text.length());
        md5hash = md.digest();
      } catch (NoSuchAlgorithmException e) {
        e.printStackTrace();
      } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
      }
      return convertToHex(md5hash);
    }
docs: Create the MD5 digest of an input text.
  
  @param text the input text
  
  @return the hexadecimal representation of the MD5 digest