Description
Introduced in SOLR-6787
The blob handler currently uses the following logic for generating/storing the md5 for uploads:
MessageDigest m = MessageDigest.getInstance("MD5"); m.update(payload.array(), payload.position(), payload.limit()); String md5 = new BigInteger(1, m.digest()).toString(16);
Unfortunately, this method does not provide padding for any md5 with less than 0x10 for its most significant byte. This means that on many occasions it could end up with a md5 hash of 31 characters instead of 32.
I have opened a PR with the following recommended change:
String md5 = new String(Hex.encodeHex(m.digest()));
Attachments
Issue Links
- links to