A DESCRIPTION OF THE PROBLEM :
The code currently uses:
for (byte b : digest) {
result.append(String.format("%X", b));
}
This will have incorrect results for byte values < 16 for which the pattern will only produce one hex char, so for example `1, 0` and `16` both would have the result `"10"`.
This should probably instead use the newly added java.util.HexFormat.
The code currently uses:
for (byte b : digest) {
result.append(String.format("%X", b));
}
This will have incorrect results for byte values < 16 for which the pattern will only produce one hex char, so for example `1, 0` and `16` both would have the result `"10"`.
This should probably instead use the newly added java.util.HexFormat.