Aut: Rationalize computeHash and ComputeMD5

Created on 30 Jul 2019  Â·  5Comments  Â·  Source: archivesunleashed/aut

I suggested on Slack that we rationalize the naming of the matchbox.package method computeHash and the ComputeMD5 object. Or eliminate one. (I vote to keep the ComputeMD5 object.) I recently pushed a change that makes the output of these identical.

@ruebot @lintool

Most helpful comment

I think I added computeHash as a quick (and hacky) way to match ids in networks before a better method was used in #289 (preferring .zipWithIndex). I cannot recall if we are still using the old way in any remaining functions -- I think maybe we deprecated them? Either way, I think it is a good job for a code reaper.

All 5 comments

Is it just this For string data, it is better to use StringUtils.computeHash().? One is for bytes and one is for strings?

Does it matter performance-wise just picking one?

computeHash just converts the string to a byte array with s.getBytes.

@lintool any objection to getting rid of computeHash and replacing it with ComputeMD5? I'm happy to do the work if you're good with it.

I think I added computeHash as a quick (and hacky) way to match ids in networks before a better method was used in #289 (preferring .zipWithIndex). I cannot recall if we are still using the old way in any remaining functions -- I think maybe we deprecated them? Either way, I think it is a good job for a code reaper.

I think it is a good job for a code reaper.

Agreed – and thanks so much for the context on this, @greebie! This all rings a bell now and a search of the code bears this out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ianmilligan1 picture ianmilligan1  Â·  6Comments

lintool picture lintool  Â·  8Comments

ruebot picture ruebot  Â·  7Comments

ruebot picture ruebot  Â·  6Comments

ruebot picture ruebot  Â·  5Comments