SHA1同MD5算法都可以用于防篡改签名
import java.io.*;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* @author yang
* @Title: SHA1.java
* @Package
* @Description: sha1算法
* @date 2019年03月20日 10:34
*/
public class SHA1 {
/**
* 计算大文件 md5获取getMD5(); SHA1获取getSha1() CRC32获取 getCRC32()
*/
protected static char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E','F' };
/**
* 计算SHA1码
*
*
* @return
* @throws OutOfMemoryError
* @throws IOException
* @throws NoSuchAlgorithmException//FileInputStream in,Long size
*/
public static String getSha1(File file) throws OutOfMemor