code: public static String md5Hex(final String input) {
  		if (input == null) {
  			throw new NullPointerException("String is null");
  		}
  
      	MessageDigest digest = null;
      	
      	try {
      		digest = MessageDigest.getInstance("MD5");
      	} catch (NoSuchAlgorithmException e) {
      		// this should never happen
      		throw new RuntimeException(e);
      	}
          
          byte[] hash = digest.digest(input.getBytes());
          
          return DatatypeConverter.printHexBinary(hash);
      }
docs: Generates an MD5 hash hex string for the input string
  @param input The input string
  @return MD5 hash hex string