import java.io.FileInputStream; import java.security.MessageDigest; class Program { public static void main(String[] args)throws Exception { MessageDigest md = MessageDigest.getInstance("MD5"); FileInputStream fis = new FileInputStream("fajlom.txt"); byte[] dataBytes = new byte[1024]; int nread = 0; while ((nread = fis.read(dataBytes)) != -1) { md.update(dataBytes, 0, nread); }; byte[] mdbytes = md.digest(); //byte to hex format StringBuffer hexString = new StringBuffer(); for (int i=0; i