Re: [Dbpedia-discussion] image url hash keys incorrect?

2012-01-04 Thread Mohamed Morsey
Hi Tommy, On 12/07/2011 12:13 AM, Tommy Chheng wrote: > This solution is also flawed. Check with Batman_Kane.jpg > > I recommend using org.apache.commons.codec.digest.DigestUtils#md5Hex > Relying on a commonly used library is a lot less bug prone. > > > On Mon, Dec 5, 2011 at 4:17 PM, Tommy Chhen

Re: [Dbpedia-discussion] image url hash keys incorrect?

2011-12-06 Thread Tommy Chheng
This solution is also flawed. Check with Batman_Kane.jpg I recommend using org.apache.commons.codec.digest.DigestUtils#md5Hex Relying on a commonly used library is a lot less bug prone. On Mon, Dec 5, 2011 at 4:17 PM, Tommy Chheng wrote: > Thanks to the folks on the wikipedia api mailing list,

Re: [Dbpedia-discussion] image url hash keys incorrect?

2011-12-05 Thread Tommy Chheng
Thanks to the folks on the wikipedia api mailing list, the problem was that the leading zero was being eaten. This will fix it in ImageExtractor#getImageUrl:    val result = (new BigInteger(1, messageDigest)).toString(16) val md5 = if (result.length % 2 != 0) "0" + result else result I woul

[Dbpedia-discussion] image url hash keys incorrect?

2011-12-03 Thread Tommy Chheng
I'm using ImageExtractor#getImageUrl in the extraction_framework to get the url of an image. val md = MessageDigest.getInstance("MD5") val messageDigest = md.digest(fileName.getBytes) val md5 = (new BigInteger(1, messageDigest)).toString(16) val hash1 = md5.substri