从消息摘要中获取 MD5 字符串
我了解它是如何工作的,但是如果我想将MD5打印出来作为字符串,我该怎么做?
public static void getMD5(String fileName) throws Exception{
    InputStream input =  new FileInputStream(fileName);
    byte[] buffer = new byte[1024];
    MessageDigest hash = MessageDigest.getInstance("MD5");
    int read;
    do {
        read = input.read(buffer);
        if (read > 0) {
            hash.update(buffer, 0, read);
        }
    } while (read != -1);
    input.close();
}
 
					 
				 
				    		 
				    		 
				    		 
				    		