MD5(){}
- /*public static String digest(String fileName) throws NoSuchAlgorithmException, IOException
- {
-
- MessageDigest md = MessageDigest.getInstance("MD5");
- return getDigest(new FileInputStream("/var/www/html/esercizi/"+fileName), md, 2048);
- }
-
- public static String getDigest(InputStream is, MessageDigest md, int byteArraySize) throws NoSuchAlgorithmException, IOException
- {
- md.reset();
- byte[] bytes = new byte[byteArraySize];
- int numBytes;
- while ((numBytes = is.read(bytes)) != -1) {
- md.update(bytes, 0, numBytes);
- }
- byte[] digest = md.digest();
- String result = new String(Hex.encodeHex(digest));
- return result;
- }*/
public static String digest(String filePath) {
InputStream inputStream = null;
try {