code: public static String calculateMd5(String input) throws NoSuchAlgorithmException {
          try {
              return calculateMd5(input, "UTF-8");
          } catch (UnsupportedEncodingException e) {
              return null; // -- impossible --
          }
      }
docs: Calculates MD5 hash for string. assume string is UTF-8 encoded
  @param input string which is going to be encoded into MD5 format
  @return  MD5 representation of the input string
  @throws NoSuchAlgorithmException if the MD5 algorithm is not available.