|
|
@@ -22,6 +22,7 @@ import java.nio.file.Path;
|
|
|
import java.nio.file.Paths;
|
|
|
import java.security.MessageDigest;
|
|
|
import java.util.Comparator;
|
|
|
+import java.util.Formatter;
|
|
|
import java.util.UUID;
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
@@ -278,8 +279,11 @@ public class FileUtils extends org.apache.commons.io.FileUtils
|
|
|
fis.close();
|
|
|
//转换并返回包含16个元素字节数组,返回数值范围为-128到127
|
|
|
byte[] md5Bytes = md.digest();
|
|
|
- BigInteger bigInt = new BigInteger(1, md5Bytes);
|
|
|
- return bigInt.toString(16);
|
|
|
+ Formatter formatter = new Formatter();
|
|
|
+ for (byte md5Byte : md5Bytes) {
|
|
|
+ formatter.format("%02x", md5Byte);
|
|
|
+ }
|
|
|
+ return formatter.toString();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return "";
|