zoukankan      html  css  js  c++  java
  • md5

    // 获取文件MD5值
        public static String getMd5(File file) throws FileNotFoundException {
            String value = null;
            FileInputStream in = null;
            try {
                in = new FileInputStream(file);
                MappedByteBuffer byteBuffer = in.getChannel().map(FileChannel.MapMode.READ_ONLY, 0, file.length());
                MessageDigest md5 = MessageDigest.getInstance("MD5");
                md5.update(byteBuffer);
                BigInteger bi = new BigInteger(1, md5.digest());
                value = bi.toString(16);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                if (null != in) {
                    try {
                        in.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
            return value;
        }

  • 相关阅读:
    alpha版本发布前的进度
    1.26~1.27
    1.23~1.25
    1月21日~1月22日工作情况
    1月17日工作情况
    1月16日小组开会
    1月15日工作进度
    1月12日~1月14日工作进度
    linux下的动态链接库管理
    小组第一次小组讨论
  • 原文地址:https://www.cnblogs.com/wenwen123/p/5848051.html
Copyright © 2011-2022 走看看