package com.qmth.file.core;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

import org.apache.commons.codec.digest.DigestUtils;

/*
 * 计算文件的md5
 */
public class FileMD5Utils {

	public static String encrypt(File file) {
		try {
			return	DigestUtils.md5Hex(new FileInputStream(file));
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

//	public static void main(String[] args) {
//		String aString = encrypt(new File("E:\\JK_SERVER_DIR\\storage\\NORMAL\\DXVK\\kw\\kc.csv"));
//		System.out.println(aString.length() + ":" + aString);
//	}

}
