in reply to Algorithm inspiration required.

Take smaller bites of your data, and checksum those bites. Then see if you can see a pattern in at least some of those bites.

Say you take four byte cheksums at every byte, and the pattern is fourteen bytes long and repeats every 30 bytes. You start collecting at offset 0, 1, 2 .. and collect checksums for those spots. By the time you get to offset 30, you'll start to see the same checksums. Now, only three of these will match, but that positive result would be enough to backtrack to 0 and compare the stream byte by byte from there and from 30.

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Replies are listed 'Best First'.
Re^2: Algorithm inspiration required.
by BrowserUk (Patriarch) on Jun 18, 2018 at 21:15 UTC

    The problem is the sequence being sought could be huge -- bigger than available memory -- and retaining all the checksums for every position will require even more memory than the sequence itself. SO the problem becomes: how to recognise which checksums must be retained and which can be discarded.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit