code: public static String md5(final String message, final int nchar) {
          final String hash = md5(message);
          return nchar > hash.length() ? hash : hash.substring(0, nchar);
      }
docs: Generates de MD5 checksum for the specified message.
  
  @param message The message.
  @param nchar   The maximum number of chars for the result hash.
  @return The hexadecimal checksum with the specified maximum number of chars.