rabinfingerprint icon indicating copy to clipboard operation
rabinfingerprint copied to clipboard

Handprint.buildAll() seems wrong

Open sandymac opened this issue 9 years ago • 1 comments

Handprint.buildAll() calls getPalm(), getAllFingers() and getHandFingers() apparently to fully compute each. But getPalm() fully consumes the InputSteam and then getAllFingers() fully consumes the InputSteam (which was now empty) and getHandFingers() calls getAllFingers() which makes the buildAll() call to getAllFingers() redundant.

If I'm right about the above this also means attempting to get the "palm" or the "fingers" in this class is mutually exclusive which I find counter intuitive based on the API.

I am trying to understand Rabin Fingerprinting via your project but it seems to me this code is just not right.

sandymac avatar Dec 18 '15 13:12 sandymac

Thanks for taking the time to file this. I'll be looking into this over the next week or two

On Friday, December 18, 2015, Sandy McArthur [email protected] wrote:

Handprint.buildAll() https://github.com/themadcreator/rabinfingerprint/blob/master/src/main/java/org/rabinfingerprint/handprint/Handprint.java#L32 calls getPalm(), getAllFingers() and getHandFingers() apparently to fully compute each. But getPalm() fully consumes the InputSteam and then getAllFingers() fully consumes the InputSteam (which was now empty) and getHandFingers() calls getAllFingers() which makes the buildAll() call to getAllFingers() redundant.

If I'm right about the above this also means attempting to get the "palm" or the "fingers" in this class is mutually exclusive which I find counter intuitive based on the API.

I am trying to understand Rabin Fingerprinting via your project but it seems to me this code is just not right.

— Reply to this email directly or view it on GitHub https://github.com/themadcreator/rabinfingerprint/issues/10.

themadcreator avatar Dec 19 '15 18:12 themadcreator