Skip to content

Commit

Permalink
Merge pull request #38 from ansforge/bug/35_fix_sha256_transcription_…
Browse files Browse the repository at this point in the history
…code_for_00_to_0F_bytes

FIX : use String.format to get the byte two-digit hexadecimel format right.
  • Loading branch information
edegenetais-nx authored and Eric Degenetais committed Jun 18, 2024
1 parent 36ffd3e commit 722a547
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ private void writeDigestEntry(final ZipOutputStream zos, MessageDigest extractEn
zos.putNextEntry(digestEntry);
byte[] hash = extractEntryDigester.digest();
for(int i=0;i<hash.length;i++){
Integer currentByte = Byte.toUnsignedInt(hash[i]);
zos.write(Integer.toHexString(currentByte).getBytes());
zos.write(String.format("%02x",hash[i]).getBytes());
}
zos.closeEntry();
}
Expand Down

0 comments on commit 722a547

Please sign in to comment.