91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 99KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-20
  • 語言: Java
  • 標簽: JAVA??MD5JS??

資源簡介

解決js和Java生成MD5值不一致問題,親自測試過,可以直接使用

資源截圖

代碼片段和文件信息

package?com.northking.test;

import?java.io.File;
import?java.io.FileInputStream;
import?java.io.FileNotFoundException;
import?java.io.IOException;
import?java.math.BigInteger;
import?java.security.MessageDigest;
import?java.security.NoSuchAlgorithmException;

public?class?MD5test?{
public?static?void?main(String[]?args)?{??
????????try?{??
????????????File?file?=?new?File(“d:/fileTest.txt“);??
????????????FileInputStream?fis?=?new?FileInputStream(file);??
????????????MessageDigest?md?=?MessageDigest.getInstance(“MD5“);??
????????????byte[]?buffer?=?new?byte[1024];??
????????????int?length?=?-1;??
????????????while?((length?=?fis.read(buffer?0?1024))?!=?-1)?{??
????????????????md.update(buffer?0?length);??
????????????}??
????????????BigInteger?bigInt?=?new?BigInteger(1?md.digest());??
????????????System.out.println(“文件md5值:“?+?bigInt.toString(16));??
????????}?catch?(FileNotFoundException?e)?{??
????????????e.printStackTrace();??
????????}?catch?(NoSuchAlgorithmException?e)?{??
????????????e.printStackTrace();??
????????}?catch?(IOException?e)?{??
????????????e.printStackTrace();??
????????}??
????}??

}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-04-25?09:36??Jsmd5\css\
?????文件????????5981??2018-04-25?09:29??Jsmd5\css\style.css
?????目錄???????????0??2018-04-25?09:43??Jsmd5\js\
?????文件??????293430??2018-04-25?09:39??Jsmd5\js\jquery-1.12.4.js
?????文件????????3186??2018-04-25?09:29??Jsmd5\js\main.js
?????文件???????23958??2018-04-25?09:43??Jsmd5\js\md5.js
?????文件????????8422??2018-04-25?09:29??Jsmd5\js\syntax-highlight.js
?????文件????????1661??2018-04-25?10:43??Jsmd5\md5.html
?????文件????????1170??2018-04-24?17:25??Jsmd5\MD5test.java

評論

共有 條評論