private static String getMD5Sum(String stringToHash){
    String md5Sum = null;
    MessageDigest md;
    ByteArrayInputStream bais = null;
    DigestInputStream dis = null;
    try {
      md = MessageDigest.getInstance("MD5");
      md.reset();
      bais = new ByteArrayInputStream(stringToHash.getBytes());
      dis = new DigestInputStream(bais, md);
      while (dis.read() != -1) {
        // just go trough bytes in file
      }
      byte[] digested = md.digest();
      StringBuffer sb = new StringBuffer();
      for (int i = 0; i < digested.length; i++) {
        // sb.append(Integer.toHexString(0xff & digested[i]));
        sb.append(Integer.toHexString((digested[i] & 0xFF) | 0x100).substring(1, 3));
      }
      md5Sum = sb.toString();
    } catch (NoSuchAlgorithmException nsae) {
      MessageBox.displayMessageBox(Display.getCurrent().getActiveShell(), SWT.ERROR,
          "Chyba !",
          "Unable to calculate MD5 sum for " + stringToHash  + nsae);
    } catch (IOException ioe ){
      
    }finally {
      if (bais != null) {
        try {
          bais.close();
        } catch (IOException ioe) {
          MessageBox.displayMessageBox(Display.getCurrent().getActiveShell(), SWT.ERROR,
              "Chyba !",
              "Unable to close Input Stream " + ioe);
          System.out.println();
        }
      }
      if (dis != null) {
        try {
          dis.close();
        } catch (IOException ioe) {
          MessageBox.displayMessageBox(Display.getCurrent().getActiveShell(), SWT.ERROR,
              "Chyba !",
              "Unable to close Digest Input Stream " + ioe);
        }
      }
    }
    return md5Sum;
  }