[ 
https://issues.apache.org/jira/browse/SOLR-13238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16929813#comment-16929813
 ] 

Jan Høydahl commented on SOLR-13238:
------------------------------------

I'm adding a CHANGES entry and fixing a precommit failure in 
{{TestBlobHandler}} and will then merge.

Thanks for the contribution Jeff. Regarding precommit failure, we have a 
workflow where we in addition to 'ant test' also run 'ant precommit' to 
validate various code requirements. We have recently added automatic CI to 
GitHub, so next PR you submit will be tested with 'ant precommit' :) Also, 
there is a new PR description template with a checklist that helps you remember 
what to do.

> BlobHandler generates non-padded md5
> ------------------------------------
>
>                 Key: SOLR-13238
>                 URL: https://issues.apache.org/jira/browse/SOLR-13238
>             Project: Solr
>          Issue Type: Bug
>          Components: blobstore
>    Affects Versions: 6.0, 6.6.5, 7.0, 7.6, 7.7
>            Reporter: Jeff Walraven
>            Assignee: Jan Høydahl
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Introduced in SOLR-6787
> The blob handler currently uses the following logic for generating/storing 
> the md5 for uploads:
> {code:java}
> MessageDigest m = MessageDigest.getInstance("MD5");
> m.update(payload.array(), payload.position(), payload.limit());
> String md5 = new BigInteger(1, m.digest()).toString(16);
> {code}
> 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:
> {code:java}
> String md5 = new String(Hex.encodeHex(m.digest()));
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to