md5加密
try {
MessageDigest md5=MessageDigest.getInstance("MD5");
File file = new File("C:\\Users\\wjw\\Desktop\\外贸\\山东外贸app页面设计参考.docx");
FileInputStream fileInputStream = new FileInputStream(file);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte[] buffer=new byte[1024];
int len =0 ;
while((len=fileInputStream.read(buffer))!=-1)
{
outputStream.write(buffer, 0, len);
}
byte[] digest = md5.digest(outputStream.toByteArray());
String string = new String(new BigInteger(1, digest).toString(16));
System.out.println(string);
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally {
}