code: public static String md5(String data) {
          try {
              return DigestUtils.md5Hex(data.toString().getBytes("UTF-8"));
          }
          catch (UnsupportedEncodingException e) {
              return DigestUtils.md5Hex(data.toString());
          }
      }
docs: generates MD5 Hash
  @param data parameter data
  @return MD5 hashed string