处理bug

This commit is contained in:
范大德 2023-10-24 21:53:09 +08:00
parent 468e66f901
commit 8a402f0538

View File

@ -96,8 +96,7 @@ class BaseIntegrity {
byte[] buffer = new byte[1024]; // The buffer to read the file
MessageDigest digest = MessageDigest.getInstance(MESSAGE_DIGEST_ALGORITHM);
int numRead = 0; // Record how many bytes have been read
digest.digest(bytes);
byte [] sha1Bytes = digest.digest();
byte [] sha1Bytes = digest.digest(bytes);
StringBuffer hexString = new StringBuffer();
for (int i = 0; i < sha1Bytes.length; i++) {
hexString.append(Integer.toString(( sha1Bytes[i] & 0xff) + 0x100, 16).substring(1));